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 2005
DescriptionThis example shows how to determine the default button when displaying a MsgBox in Visual Basic 2005. The fifth parameter to MessageBox.Show indicates the default button.
KeywordsMessageBox, MsgBox, message box, default button, VB.NET
CategoriesSoftware Engineering
 
The fifth parameter to MessageBox.Show indicates the default button. This example sets that parameter to MessageBoxDefaultButton.Button2. That makes the second button thue default button so it is initially selected when the message box appears.
 
MessageBox.Show( _
    "This is the message", _
    "The Caption", _
    MessageBoxButtons.YesNoCancel, _
    MessageBoxIcon.Information, _
    MessageBoxDefaultButton.Button2)
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated