[Tutorial] #4 - Messagebox | Advanced

Posts 16 of 6 · Page 1 of 1
[Tutorial] 4# - Messagebox | Advanced
Tutorial #4

In this tutorial im going to show you how to make and use difficult messageboxes.

To make an yes & no messagebox you can use this code

[php] Dim Message As MsgBoxResult = MsgBox("Messagehere", MsgBoxStyle.YesNo, "Title")

If Message = MsgBoxResult.Yes Then
' Do something
Else
' Do something
End If[/php]

If you want an "normal" messagebox you can use any of the following codes:

[php]Interaction.MsgBox("MessageHERE", MsgBoxStyle.OkOnly, "Title")[/php]

or:

[php] MessageBox.Show("Messagehere", "Title", MessageBoxButtons.OK)[/php]

or:

[php] MsgBox("MessageHERE", MsgBoxStyle.OkOnly, "TITLE")
[/php]

Also if you want to make error messageboxes or warnings, you should read this: MsgBox Function (Visual Basic)

For the ppl who want to learn more, try understand this and how this code works:

[php]Dim msg As String
Dim title As String
Dim style As MsgBoxStyle
Dim response As MsgBoxResult
msg = "Do you want to continue?" ' Define message.
style = MsgBoxStyle.DefaultButton2 Or _
MsgBoxStyle.Critical Or MsgBoxStyle.YesNo
title = "MsgBox Demonstration" ' Define title.
' Display message.
response = MsgBox(msg, style, title)
If response = MsgBoxResult.Yes Then ' User chose Yes.
' Perform some action.
Else
' Perform some other action.
End If[/php]

End of tut

-hej
2 tutorials in one night, Hejsan is going crazy! N1..
Quote Originally Posted by P0SEID0N View Post
2 tutorials in one night, Hejsan is going crazy! N1..
It could have been more but I had alot to do yesterday.

Hopefully I will make more today.
Haha i'm doing one a day..
100% activity is coming fo you!
Message Boxes are simple and i already knew how to do them...

Nice tutorial though. I admire your effort to write tutorials on VB for people.
Posts 16 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?