|
-
Mar 22nd, 2006, 03:49 AM
#1
Thread Starter
Member
-
Mar 22nd, 2006, 03:55 AM
#2
Re: MsgBox option
VB Code:
MsgBox "OK/Cancel Message", vbOkCancel,"Title"
MsgBox "Yes/No Message", vbYesNo,"Title"
MsgBox "Yes/No/Cancel Message + Exclamation", vbYesNoCancel + VbExclamation,"Title"
MsgBox "Critical Message", VbCritical,"Title"
MsgBox "Info Message", VbInformation,"Title"
-
Mar 22nd, 2006, 04:00 AM
#3
Frenzied Member
Re: MsgBox option
and to support the above post by jcis, to identify what button is pressed, you can do it by
VB Code:
dim a
a = msgbox "your prompt here", vbyesno,"title here"
if a = vbyes then
'yes button is clicked
else
'no button is clicked
endif
'same is true with other button groups
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
Mar 22nd, 2006, 04:03 AM
#4
Re: MsgBox option
a variable can be declared as VbMsgBoxResult
-
Mar 22nd, 2006, 04:08 AM
#5
Thread Starter
Member
Re: MsgBox option
Thanks again guyz!!
-
Mar 22nd, 2006, 05:29 AM
#6
Hyperactive Member
Re: [RESOLVED] MsgBox option
Welcom
Simple MsgBox additionally from CheckBox
VB Code:
Option Explicit
'Copyright (C) 2005 DJK's Projects (DJK)
'side of WWW, also in English language: [url]http://djkprojects.prv.pl/[/url]
'The author of example doesn't answer for possible damages called out the working following code.
Private Const IDI_HAND = 32513&
Private Const IDI_QUESTION = 32514&
Private Const IDI_EXCLAMATION = 32515&
Private Const IDI_ASTERISK = 32516&
Private Const MB_ICONHAND = &H10&
Private Const MB_ICONQUESTION = &H20&
Private Const MB_ICONEXCLAMATION = &H30&
Private Const MB_ICONASTERISK = &H40&
Private Declare Function LoadIcon Lib "user32" Alias "LoadIconA" (ByVal hInstance As Long, ByVal lpIconName As Any) As Long
Private Declare Function DrawIcon Lib "user32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal hIcon As Long) As Long
Private Declare Function DestroyIcon Lib "user32" (ByVal hIcon As Long) As Long
Private Declare Function MessageBeep Lib "user32" (ByVal wType As Long) As Long
Private Sub cmdNo_Click()
Unload Me
End Sub
Private Sub Form_Load()
ShowMsgBox IDI_ASTERISK, MB_ICONASTERISK, "ExtraMsgBox", "http://djkprojects.prv.pl"
End Sub
Private Sub ShowMsgBox(ByVal IconStyle As Long, ByVal BeepStyle As Long, ByVal Caption As String, ByVal Message As String)
Dim hIcon As Long
With picIcon
.Top = 150
.Left = 150
.AutoRedraw = True
.BorderStyle = 0
.Width = 32 * Screen.TwipsPerPixelX
.Height = 32 * Screen.TwipsPerPixelY
End With
With lblMsg
.Left = 870
.Top = 300
End With
hIcon = LoadIcon(0&, IconStyle)
Call MessageBeep(BeepStyle)
Form1.Caption = Caption
lblMsg.Caption = Message
Call DrawIcon(picIcon.hdc, 0, 0, hIcon)
Call DestroyIcon(hIcon)
End Sub
I know, I know, my English is bad, sorry .....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|