home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic .NET - Read Less - Learn More
/
Visual_Basic.NET_Read_Less_Learn_More_Richard_Bowman_Visual_2002.iso
/
Resources
/
Code
/
Ch2-OwnedForms
/
FormMain.vb
< prev
next >
Wrap
Text File
|
2001-06-24
|
3KB
|
92 lines
Public Class FormMain
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 MenuFileOpen As System.Windows.Forms.MenuItem
Friend WithEvents MenuExit As System.Windows.Forms.MenuItem
'Required by the Windows Form Designer
Private components As System.ComponentModel.Container
'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.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.MenuItem1 = New System.Windows.Forms.MenuItem()
Me.MenuFileOpen = New System.Windows.Forms.MenuItem()
Me.MenuExit = New System.Windows.Forms.MenuItem()
Me.MainMenu1 = New System.Windows.Forms.MainMenu()
'
'MenuItem1
'
Me.MenuItem1.Index = 0
Me.MenuItem1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuFileOpen, Me.MenuExit})
Me.MenuItem1.Text = "&File"
'
'MenuFileOpen
'
Me.MenuFileOpen.Index = 0
Me.MenuFileOpen.Text = "&Open..."
'
'MenuExit
'
Me.MenuExit.Index = 1
Me.MenuExit.Text = "E&xit"
'
'MainMenu1
'
Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1})
'
'FormMain
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 273)
Me.Menu = Me.MainMenu1
Me.Name = "FormMain"
Me.Text = "Main window"
End Sub
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Tools As New FormToolWindow()
Me.AddOwnedForm(Tools)
Tools.Show()
End Sub
Private Sub MenuExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuExit.Click
Close()
End Sub
Public Sub FileOpenRoutine()
MessageBox.Show("Open a file now!")
End Sub
Private Sub MenuFileOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuFileOpen.Click
FileOpenRoutine()
End Sub
End Class