关于VB中msgbox函数参数的一个问题
代码如下: msgbox "Do you want to continue?", vbOKCancel, "提示!" 如何实现让用户点击msgbox上的“确定”, ow;“取消”,End?
myresponse=msgbox("Do you want to continue?", vbOKCancel, "提示!") if myreponse=vbOK then ow else ..... end if
完整代码如下: Dim Msg, Style, Title, Help, Ctxt, Response Msg = "Do you want to continue?" ' 定义信息。 Style = VbOKCancel + vbDefaultButton1 ' 定义按钮。 Title = "提示!" ' 定义标题。 Help = "DEMO.HLP" ' 定义帮助文件。 Ctxt = 1000 ' 定义标题 ' 上下文。 ' 显示信息。 Response = MsgBox(Msg, Style, Title, Help, Ctxt) If Response = vbOK Then ' 用户按下“确定”。 Form2.Show '显示Form2窗体。 Else ' 用户按下“取消”。 End '结束整个程序。 End If