views:

229

answers:

1

is it possible to change the title of the msgbox in vb.net?

+6  A: 

Yes, use the right overloaded version of Show().

Visual Basic (Usage)
Dim text As String
Dim caption As String
Dim buttons As MessageBoxButtons
Dim returnValue As DialogResult

returnValue = MessageBox.Show(text, caption, _
    buttons)

From MSDN, (the Caption variable is the Title of the MessageBox):

Dim Message As String = "You did not enter a server name. Cancel this operation?"
Dim Caption As String = "Error Detected in Input"
Dim Buttons As MessageBoxButtons = MessageBoxButtons.YesNo

Dim Result As DialogResult

'Displays the MessageBox

Result = MessageBox.Show(Message, Caption, Buttons)
jeffamaphone
In case its not clear, "caption" is the title of the box.
maxpower47
Yeah, I said that in a parenthetical phrase above. :)
jeffamaphone