要在指定位置弹窗,你可以使用VBScript中的MsgBox函数,并使用窗口位置参数(X和Y坐标)来指定弹窗位置。下面是一个示例代码:

Set objShell = CreateObject("WScript.Shell")

' 设置弹窗位置
intX = 500 ' X坐标
intY = 300 ' Y坐标

' 弹窗消息
strMessage = "这是一个在指定位置的弹窗消息!"

' 计算窗口位置参数
intWindowLeft = intX - (objShell.AppActivate("VBScript").Width / 2)
intWindowTop = intY - (objShell.AppActivate("VBScript").Height / 2)

' 弹窗
intResult = objShell.Popup(strMessage, 0, "弹窗标题", 48 + 1, intWindowLeft, intWindowTop)

' 处理用户点击按钮的结果
If intResult = 1 Then
    MsgBox "用户点击了OK按钮!"
Else
    MsgBox "用户点击了其他按钮或弹窗超时!"
End If

请将intXintY变量的值更改为你想要的弹窗位置的X和Y坐标。在示例代码中,弹窗的位置是相对于VBScript窗口的中心位置。你也可以根据需要调整弹窗的样式和按钮选项

vbs在指定位置弹窗

原文地址: https://www.cveoy.top/t/topic/hSTi 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录