Message box Demo : MessageBox « GUI « VB.Net






Message box Demo

Message box Demo
Imports System
Imports System.Windows.Forms

Class MyFirstForm
    Inherits Form

    Private WithEvents mybutton As Button

    Public Sub New()
        Me.Text = "Hello, WinForms!"
        mybutton = New Button()
        mybutton.Text = "Click Me!"
        Me.Controls.Add(mybutton)
    End Sub

    Public Sub mybutton_Click(sender As Object, e As EventArgs) Handles mybutton.Click
        MessageBox.Show("Message")
    End Sub

    Shared Sub Main()
        Dim myform As Form = New MyFirstForm()
        Application.Run(myform)
    End Sub
End Class
           
       








Related examples in the same category

1.Message Box: Abort Retry IgnoreMessage Box: Abort Retry Ignore
2.MessageBox: OK or CancelMessageBox: OK or Cancel
3.MessageBox: Abort, Retry and IgnoreMessageBox: Abort, Retry and Ignore