vbs弹出的窗口怎么自定义按钮?

非常的急!
2024-12-20 09:26:55
推荐回答(4个)
回答1:

vbs没有GUI,只有两种弹出窗口,msgbox和inputbox,下面给出msgbox的各种情况,自己运行看实际结果,看哪种能过满足你的要求:
a=msgbox("Click yes for continue or no for exit!",vbYesNo,"information")
a=msgbox("Click yes for continue or no for exit!",vbOKOnly,"information")
a=msgbox("Click yes for continue or no for exit!",vbOKCancel,"information")
a=msgbox("Click yes for continue or no for exit!",vbAbortRetryIgnore,"information")
a=msgbox("Click yes for continue or no for exit!",vbYesNoCancel,"information")
a=msgbox("Click yes for continue or no for exit!",vbRetryCancel,"information")

a=msgbox("Click yes for continue or no for exit!",4,"information")
a=msgbox("Click yes for continue or no for exit!",0,"information")
a=msgbox("Click yes for continue or no for exit!",1,"information")
a=msgbox("Click yes for continue or no for exit!",2,"information")
a=msgbox("Click yes for continue or no for exit!",3,"information")
a=msgbox("Click yes for continue or no for exit!",5,"information")

a=msgbox("Click yes for continue or no for exit!",16,"Critical")
a=msgbox("Click yes for continue or no for exit!",0,"Question")
a=msgbox("Click yes for continue or no for exit!",0,"Exclamation")
a=msgbox("Click yes for continue or no for exit!",0,"information")

回答2:

调用ie可解
Set a=CreateObject("WScript.shell")
set ie=wscript.createobject("internetexplorer.application","event_")
ie.menubar=0
ie.addressbar=0
ie.toolbar=0
ie.statusbar=0
ie.width=400
ie.height=500
ie.resizable=0
ie.navigate "about:blank"
ie.left=fix((ie.document.parentwindow.screen.availwidth-ie.width)/2)
ie.top=fix((ie.document.parentwindow.screen.availheight-ie.height)/2)
ie.visible=1
with ie.document
.write "QQ:1138736581"
.write "

魔:快捷小工具

"
.write "


"
.write "

"
.write "

"
.write "

"
.write "

"
.write "

"
.write "

"
.write "

"
.write "

"
.write ""
end with
set wnd=ie.document.parentwindow
set id=ie.document.all
id.msconfig.onclick=getref("msconfig")
id.regedit.onclick=getref("regedit")
id.diskmgmt.onclick=GetRef("diskmgmt")
id.gpedit.onclick=GetRef("gpedit")
id.cliconfg.onclick=GetRef("cliconfg")
id.cmd.onclick=GetRef("cmd")
id.fsquirt.onclick=GetRef("fsquirt")
id.fsmgmt.onclick=GetRef("fsmgmt")
id.lusrmgr.onclick=GetRef("lusrmgr")
id.mstsc.onclick=GetRef("mstsc")
id.syskey.onclick=GetRef("syskey")
id.rasphone.onclick=GetRef("rasphone")
id.perfmon.onclick=GetRef("perfmon")
id.narrator.onclick=GetRef("narrator")
do while true
wscript.sleep 200
loop
sub event_onquit 'ie退出事件处理过程'
wscript.quit
end sub

sub msconfig
a.Run "msconfig"
End sub
Sub regedit
a.Run "regedit"
End sub
Sub diskmgmt
a.Run "diskmgmt.msc"
End sub
Sub gpedit
a.Run "gpedit.msc"
End Sub
Sub cliconfg
a.Run "cliconfg"
End sub
Sub cmd
a.Run "cmd"
End Sub
Sub fsquirt
a.Run "fsquirt"
End Sub
Sub fsmgmt
a.Run "fsmgmt.msc"
End Sub
Sub lusrmgr
a.Run "lusrmgr.msc"
End Sub
Sub mstsc
a.Run "mstsc"
End Sub
Sub syskey
a.Run "syskey"
End Sub
Sub rasphone
a.Run "rasphone"
End Sub
Sub perfmon
a.Run "perfmon"
End Sub
Sub narrator
a.Run "narrator"
End Sub

回答3:

这个VBS是没办法办到的,用VB的话应该是可以的。

回答4:

你所说的自定义是什么意思?是MSGBOX 窗口上的按钮吗?