📄 form2.vb
字号:
Public Class Form2
Inherits System.Windows.Forms.Form
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
End Sub
'窗体重写 dispose 以清理组件列表。
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
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改此过程。
'不要使用代码编辑器修改它。
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 MenuItem4 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem5 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem6 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem7 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem9 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem10 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem11 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem12 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem13 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem14 As System.Windows.Forms.MenuItem
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents ToolBar1 As System.Windows.Forms.ToolBar
Friend WithEvents ToolBarButton1 As System.Windows.Forms.ToolBarButton
Friend WithEvents ToolBarButton2 As System.Windows.Forms.ToolBarButton
Friend WithEvents ToolBarButton3 As System.Windows.Forms.ToolBarButton
Friend WithEvents ToolBarButton4 As System.Windows.Forms.ToolBarButton
Friend WithEvents ImageList1 As System.Windows.Forms.ImageList
Friend WithEvents Timer1 As System.Windows.Forms.Timer
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form2))
Me.MainMenu1 = New System.Windows.Forms.MainMenu
Me.MenuItem1 = New System.Windows.Forms.MenuItem
Me.MenuItem5 = New System.Windows.Forms.MenuItem
Me.MenuItem6 = New System.Windows.Forms.MenuItem
Me.MenuItem7 = New System.Windows.Forms.MenuItem
Me.MenuItem2 = New System.Windows.Forms.MenuItem
Me.MenuItem9 = New System.Windows.Forms.MenuItem
Me.MenuItem10 = New System.Windows.Forms.MenuItem
Me.MenuItem11 = New System.Windows.Forms.MenuItem
Me.MenuItem3 = New System.Windows.Forms.MenuItem
Me.MenuItem12 = New System.Windows.Forms.MenuItem
Me.MenuItem13 = New System.Windows.Forms.MenuItem
Me.MenuItem14 = New System.Windows.Forms.MenuItem
Me.MenuItem4 = New System.Windows.Forms.MenuItem
Me.Label1 = New System.Windows.Forms.Label
Me.ToolBar1 = New System.Windows.Forms.ToolBar
Me.ToolBarButton1 = New System.Windows.Forms.ToolBarButton
Me.ToolBarButton2 = New System.Windows.Forms.ToolBarButton
Me.ToolBarButton3 = New System.Windows.Forms.ToolBarButton
Me.ToolBarButton4 = New System.Windows.Forms.ToolBarButton
Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components)
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
Me.SuspendLayout()
'
'MainMenu1
'
Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem2, Me.MenuItem3, Me.MenuItem4})
'
'MenuItem1
'
Me.MenuItem1.Index = 0
Me.MenuItem1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem5, Me.MenuItem6, Me.MenuItem7})
Me.MenuItem1.Text = "编辑数据(&e)"
'
'MenuItem5
'
Me.MenuItem5.Index = 0
Me.MenuItem5.Text = "教师基本情况表"
'
'MenuItem6
'
Me.MenuItem6.Index = 1
Me.MenuItem6.Text = "教师电话号码表"
'
'MenuItem7
'
Me.MenuItem7.Index = 2
Me.MenuItem7.Text = "教师工资情况表"
'
'MenuItem2
'
Me.MenuItem2.Index = 1
Me.MenuItem2.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem9, Me.MenuItem10, Me.MenuItem11})
Me.MenuItem2.Text = "数据处理(&o)"
'
'MenuItem9
'
Me.MenuItem9.Index = 0
Me.MenuItem9.Text = "查询基本情况"
'
'MenuItem10
'
Me.MenuItem10.Index = 1
Me.MenuItem10.Text = "查询工资情况"
'
'MenuItem11
'
Me.MenuItem11.Index = 2
Me.MenuItem11.Text = "查询联系方式"
'
'MenuItem3
'
Me.MenuItem3.Index = 2
Me.MenuItem3.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem12, Me.MenuItem13, Me.MenuItem14})
Me.MenuItem3.Text = "数据报表(&r)"
'
'MenuItem12
'
Me.MenuItem12.Index = 0
Me.MenuItem12.Text = "教师基本情况表"
'
'MenuItem13
'
Me.MenuItem13.Index = 1
Me.MenuItem13.Text = "联系方式列表"
'
'MenuItem14
'
Me.MenuItem14.Index = 2
Me.MenuItem14.Text = "工资报表"
'
'MenuItem4
'
Me.MenuItem4.Index = 3
Me.MenuItem4.Text = "退出(&h)"
'
'Label1
'
Me.Label1.BackColor = System.Drawing.SystemColors.ControlDark
Me.Label1.Location = New System.Drawing.Point(0, 0)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(376, 8)
Me.Label1.TabIndex = 0
'
'ToolBar1
'
Me.ToolBar1.Buttons.AddRange(New System.Windows.Forms.ToolBarButton() {Me.ToolBarButton1, Me.ToolBarButton2, Me.ToolBarButton3, Me.ToolBarButton4})
Me.ToolBar1.DropDownArrows = True
Me.ToolBar1.ImageList = Me.ImageList1
Me.ToolBar1.Location = New System.Drawing.Point(0, 0)
Me.ToolBar1.Name = "ToolBar1"
Me.ToolBar1.ShowToolTips = True
Me.ToolBar1.Size = New System.Drawing.Size(376, 41)
Me.ToolBar1.TabIndex = 1
'
'ToolBarButton1
'
Me.ToolBarButton1.ImageIndex = 0
Me.ToolBarButton1.Text = "查询"
'
'ToolBarButton2
'
Me.ToolBarButton2.ImageIndex = 1
Me.ToolBarButton2.Text = "删除"
'
'ToolBarButton3
'
Me.ToolBarButton3.ImageIndex = 2
Me.ToolBarButton3.Text = "修改"
'
'ToolBarButton4
'
Me.ToolBarButton4.ImageIndex = 3
Me.ToolBarButton4.Text = "更新"
'
'ImageList1
'
Me.ImageList1.ImageSize = New System.Drawing.Size(16, 16)
Me.ImageList1.ImageStream = CType(resources.GetObject("ImageList1.ImageStream"), System.Windows.Forms.ImageListStreamer)
Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent
'
'Form2
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(376, 309)
Me.Controls.Add(Me.ToolBar1)
Me.Controls.Add(Me.Label1)
Me.IsMdiContainer = True
Me.Menu = Me.MainMenu1
Me.Name = "Form2"
Me.Text = "教师管理系统"
Me.ResumeLayout(False)
End Sub
#End Region
Private Function ismymdichild(ByVal childformname As String) As Boolean
Dim childform As Form
For Each childform In Me.MdiChildren
If childform.Name = childformname Then
childform.Activate()
Return True
End If
Next
End Function
Private Sub form2_load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub MenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem4.Click
Application.Exit()
End Sub
Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles ToolBar1.ButtonClick
Select Case ToolBar1.Buttons.IndexOf(e.Button)
Case 0
MenuItem5_Click(sender, e)
Case 1
MenuItem9_Click(sender, e)
Case 2
' MenuItem3_Click(sender, e)
Case 3
Application.Exit()
End Select
End Sub
Private Sub MenuItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem5.Click
If Not ismymdichild("frmteachers") Then
Dim mychild As New Form2
mychild.MdiParent = Me
mychild.Show()
End If
End Sub
Private Sub MenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem6.Click
If Not ismymdichild("frmteachertel") Then
Dim mychild As New Form2
mychild.MdiParent = Me
mychild.Show()
End If
End Sub
Private Sub MenuItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem7.Click
If Not ismymdichild("frmteachersal") Then
Dim mychild As New Form2
mychild.MdiParent = Me
mychild.Show()
End If
End Sub
Private Sub MenuItem9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem9.Click
If Not ismymdichild("frmteacherQ") Then
Dim mychild As New Form2
mychild.MdiParent = Me
mychild.Show()
End If
End Sub
Private Sub MenuItem10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem10.Click
If Not ismymdichild("frmTeacherT") Then
Dim mychild As New Form2
mychild.MdiParent = Me
mychild.Show()
End If
End Sub
Private Sub MenuItem11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem11.Click
If Not ismymdichild("frmteacherR ") Then
Dim mychild As New Form2
mychild.MdiParent = Me
mychild.Show()
End If
End Sub
Private Sub MenuItem12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem12.Click
If Not ismymdichild("frmteacherSs ") Then
Dim mychild As New Form2
mychild.MdiParent = Me
mychild.Show()
End If
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -