-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMDIParent1.vb
115 lines (88 loc) · 5 KB
/
MDIParent1.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
Imports System.Windows.Forms
Public Class MDIParent1
Private Sub ShowNewForm(ByVal sender As Object, ByVal e As EventArgs) Handles NewToolStripMenuItem.Click, NewToolStripButton.Click, NewWindowToolStripMenuItem.Click
' Create a new instance of the child form.
Dim ChildForm As New System.Windows.Forms.Form
' Make it a child of this MDI form before showing it.
ChildForm.MdiParent = Me
m_ChildFormNumber += 1
ChildForm.Text = "Window " & m_ChildFormNumber
ChildForm.Show()
End Sub
Private Sub OpenFile(ByVal sender As Object, ByVal e As EventArgs) Handles OpenToolStripMenuItem.Click, OpenToolStripButton.Click
Dim OpenFileDialog As New OpenFileDialog
OpenFileDialog.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments
OpenFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
If (OpenFileDialog.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then
Dim FileName As String = OpenFileDialog.FileName
' TODO: Add code here to open the file.
End If
End Sub
Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles SaveAsToolStripMenuItem.Click
Dim SaveFileDialog As New SaveFileDialog
SaveFileDialog.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments
SaveFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
If (SaveFileDialog.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then
Dim FileName As String = SaveFileDialog.FileName
' TODO: Add code here to save the current contents of the form to a file.
End If
End Sub
Private Sub ExitToolsStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ExitToolStripMenuItem.Click
Me.Close()
End Sub
Private Sub CutToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles CutToolStripMenuItem.Click
' Use My.Computer.Clipboard to insert the selected text or images into the clipboard
End Sub
Private Sub CopyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles CopyToolStripMenuItem.Click
' Use My.Computer.Clipboard to insert the selected text or images into the clipboard
End Sub
Private Sub PasteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles PasteToolStripMenuItem.Click
'Use My.Computer.Clipboard.GetText() or My.Computer.Clipboard.GetData to retrieve information from the clipboard.
End Sub
Private Sub ToolBarToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ToolBarToolStripMenuItem.Click
Me.ToolStrip.Visible = Me.ToolBarToolStripMenuItem.Checked
End Sub
Private Sub StatusBarToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles StatusBarToolStripMenuItem.Click
Me.StatusStrip.Visible = Me.StatusBarToolStripMenuItem.Checked
End Sub
Private Sub CascadeToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles CascadeToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.Cascade)
End Sub
Private Sub TileVerticalToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles TileVerticalToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.TileVertical)
End Sub
Private Sub TileHorizontalToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles TileHorizontalToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.TileHorizontal)
End Sub
Private Sub ArrangeIconsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ArrangeIconsToolStripMenuItem.Click
Me.LayoutMdi(MdiLayout.ArrangeIcons)
End Sub
Private Sub CloseAllToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles CloseAllToolStripMenuItem.Click
' Close all child forms of the parent.
For Each ChildForm As Form In Me.MdiChildren
ChildForm.Close()
Next
End Sub
Private m_ChildFormNumber As Integer
Private Sub FileMenu_Click(sender As Object, e As EventArgs) Handles FileMenu.Click
Form1.Show()
End Sub
Private Sub EditMenu_Click(sender As Object, e As EventArgs) Handles EditMenu.Click
Form2.Show()
End Sub
Private Sub HelpMenu_Click(sender As Object, e As EventArgs) Handles HelpMenu.Click
Me.Close()
End Sub
Private Sub ToolsMenu_Click(sender As Object, e As EventArgs) Handles ToolsMenu.Click
tester.Show()
End Sub
Private Sub WindowsMenu_Click(sender As Object, e As EventArgs) Handles WindowsMenu.Click
Eve.Show()
End Sub
Private Sub AgeToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AgeToolStripMenuItem.Click
Age.Show()
End Sub
Private Sub TimesToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles TimesToolStripMenuItem.Click
times.Show()
End Sub
End Class