.Net Programming

Different Types of MessageBoxes in VB.Net

MessageBox Displays a modal dialog box that contains a system icon, a set of buttons, and a brief application-specific message, such as status or error information. The message box returns an integer value that indicates which button the user clicked. Simply put, a messagebox displays a message and its characteristics can be changed using different styles as explained in the following program

Language : VB.Net

[sourcecode language="vb">
Public Class MessageBox
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("Hello World")
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
MsgBox("Hello World", MsgBoxStyle.Information)
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
MsgBox("Hello World", MsgBoxStyle.Exclamation)
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
MsgBox("Hello World", MsgBoxStyle.MsgBoxHelp)
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
MsgBox("Hello World", MsgBoxStyle.AbortRetryIgnore)
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
MsgBox("Hello World", MsgBoxStyle.Question)
End Sub
End Class
[/sourcecode]



{ 2 comments… read them below or add one }

1 vignesh.S July 19, 2010 at 12:41 pm

send any article about vb.net to my corresponding email id

Reply

2 vignesh.S July 19, 2010 at 2:41 pm

send any article about vb.net to my corresponding email id

Reply

Leave a Comment

Notify me of followup comments via e-mail. You can also subscribe without commenting.


WordPress - Vaibhav Kanwal