Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. 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 MainMenu1 As System.Windows.Forms.MainMenu Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem Friend WithEvents ImageList1 As System.Windows.Forms.ImageList Friend WithEvents StatusBar1 As System.Windows.Forms.StatusBar Friend WithEvents ToolBar1 As System.Windows.Forms.ToolBar Friend WithEvents ToolBarButton1 As System.Windows.Forms.ToolBarButton Friend WithEvents MdiClient1 As System.Windows.Forms.MdiClient Private components As System.ComponentModel.IContainer 'Required by the Windows Form Designer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. _ Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Me.StatusBar1 = New System.Windows.Forms.StatusBar() Me.ToolBar1 = New System.Windows.Forms.ToolBar() Me.ToolBarButton1 = New System.Windows.Forms.ToolBarButton() Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components) Me.MainMenu1 = New System.Windows.Forms.MainMenu() Me.MenuItem1 = New System.Windows.Forms.MenuItem() Me.MenuItem3 = New System.Windows.Forms.MenuItem() Me.MenuItem2 = New System.Windows.Forms.MenuItem() Me.MdiClient1 = New System.Windows.Forms.MdiClient() Me.SuspendLayout() ' 'StatusBar1 ' Me.StatusBar1.Location = New System.Drawing.Point(0, 149) Me.StatusBar1.Name = "StatusBar1" Me.StatusBar1.Size = New System.Drawing.Size(292, 20) Me.StatusBar1.TabIndex = 0 Me.StatusBar1.Text = "StatusBar1" ' 'ToolBar1 ' Me.ToolBar1.Appearance = System.Windows.Forms.ToolBarAppearance.Flat Me.ToolBar1.Buttons.AddRange(New System.Windows.Forms.ToolBarButton() {Me.ToolBarButton1}) Me.ToolBar1.DropDownArrows = True Me.ToolBar1.ImageList = Me.ImageList1 Me.ToolBar1.Name = "ToolBar1" Me.ToolBar1.ShowToolTips = True Me.ToolBar1.Size = New System.Drawing.Size(292, 39) Me.ToolBar1.TabIndex = 1 ' 'ToolBarButton1 ' Me.ToolBarButton1.ImageIndex = 0 Me.ToolBarButton1.Tag = "101" Me.ToolBarButton1.Text = "Click Me" Me.ToolBarButton1.ToolTipText = "Click to launch another form" ' 'ImageList1 ' Me.ImageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit Me.ImageList1.ImageSize = New System.Drawing.Size(16, 16) Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent ' 'MainMenu1 ' Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem2}) ' 'MenuItem1 ' Me.MenuItem1.Index = 0 Me.MenuItem1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem3}) Me.MenuItem1.Text = "&File" ' 'MenuItem3 ' Me.MenuItem3.Index = 0 Me.MenuItem3.Text = "E&xit" ' 'MenuItem2 ' Me.MenuItem2.Index = 1 Me.MenuItem2.Text = "&Help" ' 'MdiClient1 ' Me.MdiClient1.Dock = System.Windows.Forms.DockStyle.Fill Me.MdiClient1.Location = New System.Drawing.Point(0, 39) Me.MdiClient1.Name = "MdiClient1" Me.MdiClient1.TabIndex = 2 ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(292, 169) Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.ToolBar1, Me.StatusBar1, Me.MdiClient1}) Me.IsMdiContainer = True Me.Menu = Me.MainMenu1 Me.Name = "Form1" Me.Text = "Form1" Me.TransparencyKey = System.Drawing.Color.LightPink Me.ResumeLayout(False) End Sub #End Region Private Sub MenuItem3_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MenuItem3.Click End End Sub Private Sub ToolBar1_ButtonClick _ (ByVal sender As System.Object, _ ByVal e As _ System.Windows.Forms.ToolBarButtonClickEventArgs) Handles _ ToolBar1.ButtonClick If CType(e.Button.Tag(), String) = "101" Then Dim NewForm As Form2 = New Form2() If NewForm.ShowDialog(Me) = DialogResult.OK Then ' OK was pressed on the Dialog Box End If End If End Sub End Class