您的位置:程序门 -> vb -> 基础类



怎样使msgbox方法弹出的警告窗体位于当前屏幕最前方?


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


怎样使msgbox方法弹出的警告窗体位于当前屏幕最前方?[已结贴,结贴人:jack20042005]
发表于:2007-07-04 23:21:17 楼主
谢谢!
发表于:2007-07-05 08:33:281楼 得分:5
option   explicit

private   declare   function   messagebox   lib   "user32.dll "   alias   "messageboxa "   (byval   hwnd   as   long,   byval   lptext   as   string,   byval   lpcaption   as   string,   byval   wtype   as   long)   as   long


const   idok   =   1
const   idcancel   =   2
const   idabort   =   3
const   idretry   =   4
const   idtryagain   =   4
const   idcontinue   =   5
const   idignore   =   5
const   idyes   =   6
const   idno   =   7
const   idclose   =   8,
const   idhelp   =   9,
const   idtryagain   =   10,
const   idcontinue   =   11,
const   idtimeout   =   32000

const   mb_ok   =   0
const   mb_okcancel   =   1
const   mb_abortretryignore   =   2
const   mb_canceltrycontinue   =   2
const   mb_yesnocancel   =   3
const   mb_yesno   =   4
const   mb_retrycancel   =   5

const   mb_iconhand   =   &h10
const   mb_iconerror   =   mb_iconhand
const   mb_iconstop   =   mb_iconhand
const   mb_iconquestion   =   &h20
const   mb_iconexclamation   =   &h30
const   mb_iconwarning   =   mb_iconexclamation
const   mb_iconasterisk   =   &h40
const   mb_iconinformation   =   mb_iconasterisk
const   mb_usericon   =   &h80

const   mb_defbutton1   =   &h0
const   mb_defbutton2   =   &h100
const   mb_defbutton3   =   &h200
const   mb_defbutton4   =   &h300

const   mb_applmodal   =   &h0
const   mb_systemmodal   =   &h1000
const   mb_taskmodal   =   &h2000
const   mb_help   =   &h4000

const   mb_setforeground   =   &h10000
const   mb_default_desktop_only   =   &h20000
const   mb_service_notification_nt3x   =   &h40000
const   mb_topmost   =   &h40000
const   mb_right   =   &h80000

const   mb_rtlreading   =   &h100000
const   mb_service_notification   =   &h200000


private   sub   command1_click()

messagebox   me.hwnd,   "aaaaaaaaaa ",   app.title,   mb_iconexclamation   +   mb_topmost

end   sub
发表于:2007-07-05 09:29:222楼 得分:2
msgbox   "mytips ",   262144   or   vbinformation   , "tips "
将msgbox   原先的样式参数和   262144   作 "or "运算即可
发表于:2007-07-05 12:31:183楼 得分:0
msgbox   "mytips ",   262144   or   vbinformation   , "tips "

"mytips "---对话框标题吧

"tips "---鼠标移动到对话框才显示的提示吧

262144   or   vbinformation   ---这个参数啥意思?
发表于:2007-07-05 12:46:104楼 得分:0
我上面不是已经说了吗?
将msgbox   原先的样式参数和   262144   作 "or "运算即可

样式指,msgbox()   的图标和按钮.
发表于:2007-07-05 13:09:115楼 得分:0
关注中
发表于:2007-07-05 18:15:156楼 得分:3
msgbox   "test ",   vbsystemmodal
就可以了
发表于:2007-07-05 18:24:597楼 得分:0
mark


快速检索

最新资讯
热门点击