在线===,一个关于msgbox的问题

wshxcxw 2003-07-18 04:19:12
我写的程序如下:为什么不能运行呢?

dim a as msgboxresult
a=msgbox("ok",MsgBoxStyle.Critical,"title")

结果运行不过去!!!!
...全文
43 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
sweet12345 2003-07-22
  • 打赏
  • 举报
回复
你的那个代码完全可以运行,不信你在试试看。
sandju 2003-07-22
  • 打赏
  • 举报
回复
不可能吧,应该可以运行的,是不是你的vs.net的环境出了问题?还史你的问题体没有描述清楚?
wf79 2003-07-22
  • 打赏
  • 举报
回复
iRet = MsgBox("ok", MsgBoxStyle.Critical, "title")
If iRet = MsgBoxResult.OK Then
....
End If
不过MsgBoxStyle.Critical好像返回值只有ok,所以判断也没有什么用。
qiongguoer 2003-07-19
  • 打赏
  • 举报
回复
我使用msgbox时出现了以下错误:
在应用程序未以 UserInteractive 模式运行的情况下显示有模式对话框或窗体是无效的操作。请指定 ServiceNotification 或 DefaultDesktopOnly 样式,以显示服务应用程序发出的通知。
szch 2003-07-18
  • 打赏
  • 举报
回复
if msgbox("continue?",msgboxstyle.yesno,"title")=msgboxstyle.no then
exit sub
endif
netbase 2003-07-18
  • 打赏
  • 举报
回复
MsgBoxResult是枚举类型,你必须引用具体的枚举值。
比如MsgBoxResult.OK
通常这样用:
if msgbox("ok",MsgBoxStyle.Critical,"title")=MsgBoxResult.OK then
'按OK按钮的处理
else
'按其他按钮的处理
end if
Montaque 2003-07-18
  • 打赏
  • 举报
回复
msgbox是模式的对话框,你必须点击后才能进行后面的操作。
0909424 2003-07-18
  • 打赏
  • 举报
回复
我上边的怎么不能运行呢?

我试试你的方法
xDotNet 2003-07-18
  • 打赏
  • 举报
回复

试试这个:

dim a as integer
a=msgbox("ok",16+0,"title")
console.writeline(a.tostring)
a=msgbox("ok",32+1,"title")
console.writeline(a.tostring)
a=msgbox("ok",48+2,"title")
console.writeline(a.tostring)
greystar 2003-07-18
  • 打赏
  • 举报
回复
这是vb的
panyee 2003-07-18
  • 打赏
  • 举报
回复
要几个按钮,就把要的铵钮的值加起来
panyee 2003-07-18
  • 打赏
  • 举报
回复
http://www.devguru.com/Technologies/vbscript/quickref/msgbox.html

Implemented in version 1.0

MsgBox(Prompt, Buttons, Title)

MsgBox(Prompt, Buttons, HelpFile, Context)

The MsgBox function creates a dialog box with a specified message and prompts the user to click a button, upon which the dialog box closes and a value relating to which button was clicked is returned. These values, along with their Constants, are listed in the table below.

CONSTANT VALUE BUTTON
VBOK 1 OK
VBCancel 2 Cancel
VBAbort 3 Abort
VBRetry 4 Retry
VBIgnore 5 Ignore
VBYes 6 Yes
VBNo 7 No
0909424 2003-07-18
  • 打赏
  • 举报
回复
在线qq是:150397019
0909424 2003-07-18
  • 打赏
  • 举报
回复

不明白?能具体点吗?
XXSingle 2003-07-18
  • 打赏
  • 举报
回复
不懂VB.........
panyee 2003-07-18
  • 打赏
  • 举报
回复
msgbox("OK", "title")
panyee 2003-07-18
  • 打赏
  • 举报
回复
msgbox("ok","title")

16,720

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧