|
|
Title | Determine the default button when displaying a MsgBox in Visual Basic 6 |
Description | This 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. |
Keywords | MsgBox, message box, default button, Visual Basic 6 |
Categories | Software 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
|
|
|
|
|
|