Public Class Form2 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() InitializeComponent() End Sub Protected Overloads Overrides Sub Dispose _ (ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub Friend WithEvents Button1 As System.Windows.Forms.Button Private components As System.ComponentModel.IContainer _ Private Sub InitializeComponent() Me.Button1 = New System.Windows.Forms.Button() Me.SuspendLayout() ' 'Button1 ' Me.Button1.Location = New System.Drawing.Point(224, 200) Me.Button1.Name = "Button1" Me.Button1.TabIndex = 10 Me.Button1.Text = "Button1" ' 'Form2 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(312, 245) Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Button1}) Me.Name = "Form2" Me.Text = "Form2" Me.ResumeLayout(False) End Sub #End Region Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim NewForm2 As Form3 = New Form3() If NewForm2.ShowDialog(Me) = DialogResult.OK Then ' OK was pressed on the Dialog Box End If End Sub End Class