20-Advanced MessageBox

0
468

This Visual Basic Tutorial is all about Advanced MessageBox.
In this section, you will learn here how to display a message in the messagebox and make it more advance by changing the icon and the buttons displayed.

 

This is the syntax of the advance messagebox:

[vb]

if  MessageBox.Show([message],[title], [actions] ,[icon]) = [dialog result]  then

statements..

else

statements..

end if

 

[/vb]

example

[vb]

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If MessageBox.Show(“Hello World”, “hello world”, MessageBoxButtons.YesNo, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
MessageBox.Show(“clicked yes”)
Else
MessageBox.Show(“clicked no”)
End If
End Sub

End Class

[/vb]
Facebook Comments

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.