How to add a new line in messsagebox?

  • Thread starter Thread starter ¤s¤t
  • Start date Start date
MsgBox("Hello" & vbCrLf & vbCrLf & _
"How are you?." & vbCrLf & vbCrLf & _
"The Packers are going to the Super Bowl." & vbCrLf & vbCrLf & _
"Do you wish to continue?", MsgBoxStyle.YesNo)
If Ans = vbNo Then
Exit Sub
Else
'do this action
End If

or maybe

MsgBox("the Packers will win the super bowl.", MsgBoxStyle.Information)




MsgBox("This is a test",
 
Ans doesn't work?
KJM said:
MsgBox("Hello" & vbCrLf & vbCrLf & _
"How are you?." & vbCrLf & vbCrLf & _
"The Packers are going to the Super Bowl." & vbCrLf & vbCrLf & _
"Do you wish to continue?", MsgBoxStyle.YesNo)
If Ans = vbNo Then
Exit Sub
Else
'do this action
End If

or maybe

MsgBox("the Packers will win the super bowl.", MsgBoxStyle.Information)




MsgBox("This is a test",
 
Hi KJM,

Do not take attention to it, I correct it beneath, but the sample from you
was about vbCrlf not about the msgbox and that was a correct answer.

If MsgBox("Hello" & vbCrLf & vbCrLf & _
"How are you?." & vbCrLf & vbCrLf & _
"The Packers are going to the Super Bowl." & vbCrLf & vbCrLf & _
"Do you wish to continue?", MsgBoxStyle.YesNo) = vbNo Then
MessageBox.Show("Who are the Packers?" & vbCrLf & "I do not know
them")
End If

Cor
 
"The Packers are going to the Super Bowl." & vbCrLf & vbCrLf & _
Only if they win this weekend? Hope to see them in St. Louis!

Cheers,
Rob Panosh
Disappointed Rams Fan!
 
* "¤s¤t said:
messagebox.show(" ????")

\\\
MessageBox.Show( _
"Foo" & ControlChars.NewLine & _
"Bar" _
)
///

Instead of 'ControlChars.NewLine', you can use 'Environment.NewLine' or
'vbNewLine' too.
 
Back
Top