Displaying an image in a VBScript MsgBox

匆匆过客 提交于 2019-12-03 23:07:32

问题


How can I display an image in a MsgBox?


回答1:


What you want is called a HyperText Application, or HTA. You use HTML to create the form.




回答2:


The answer is: this is not possible. MsgBox can only display strings.

Documentation: http://msdn.microsoft.com/en-us/library/sfw6660x%28v=vs.85%29.aspx

An alternative is to display your image in a small Internet Explorer window. Here's an example:

Set objExplorer = CreateObject("InternetExplorer.Application")

With objExplorer
    .Navigate "about:blank"
    .ToolBar = 0
    .StatusBar = 0
    .Left = 100
    .Top = 100
    .Width = 200
    .Height = 200
    .Visible = 1
    .Document.Title = "Important image!"
    .Document.Body.InnerHTML = _
        "<img src='http://sstatic.net/stackoverflow/img/venn-diagram.png' height=100 width=100>"
End With

This should display the Venn diagram found in Stack Overflow's about section.



来源:https://stackoverflow.com/questions/7172431/displaying-an-image-in-a-vbscript-msgbox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!