是否可以在 vb.net 中更改 msgbox 的标题?
问问题
23092 次
1 回答
9
是的,使用正确的重载版本 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)
来自 MSDN(Caption
变量是 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)
于 2009-08-20T19:47:17.743 回答