Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleDetermine the default button when displaying a MsgBox in Visual Basic 6
DescriptionThis example shows how to determine the default button when displaying a MsgBox in Visual Basic 6.The program uses the Or operator to add the vbDefaultButton2 flag to the Buttons parameter of the call to MsgBox.
KeywordsMsgBox, message box, default button, Visual Basic 6
CategoriesSoftware Engineering
 
The program uses the Or operator to add the vbDefaultButton2 flag to the Buttons parameter of the call to MsgBox. That makes the second button thue default button so it is initially selected when the message box appears.
 
Private Sub cmdDisplayMessage_Click()
    MsgBox "This is the message", vbYesNoCancel Or _
        vbDefaultButton2, "The Title"
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated