📄 formbase.0.vb
字号:
Imports CommonDB
Public Class FormBase
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 pnlTop As System.Windows.Forms.Panel
Friend WithEvents pnlLeft As System.Windows.Forms.Panel
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox
Friend WithEvents lblCaption As System.Windows.Forms.Label
Friend WithEvents Splitter1 As System.Windows.Forms.Splitter
Friend WithEvents pnlName As System.Windows.Forms.Panel
Friend WithEvents tvStudent As System.Windows.Forms.TreeView
Friend WithEvents Splitter2 As System.Windows.Forms.Splitter
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
Friend WithEvents btnOK As System.Windows.Forms.Button
Friend WithEvents btnCancel As System.Windows.Forms.Button
Friend WithEvents btnExit As System.Windows.Forms.Button
Friend WithEvents ilTreeView As System.Windows.Forms.ImageList
Friend WithEvents ilButton As System.Windows.Forms.ImageList
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(FormBase))
Me.pnlTop = New System.Windows.Forms.Panel
Me.Splitter2 = New System.Windows.Forms.Splitter
Me.lblCaption = New System.Windows.Forms.Label
Me.PictureBox2 = New System.Windows.Forms.PictureBox
Me.PictureBox1 = New System.Windows.Forms.PictureBox
Me.pnlLeft = New System.Windows.Forms.Panel
Me.tvStudent = New System.Windows.Forms.TreeView
Me.ilTreeView = New System.Windows.Forms.ImageList(Me.components)
Me.Splitter1 = New System.Windows.Forms.Splitter
Me.pnlName = New System.Windows.Forms.Panel
Me.GroupBox2 = New System.Windows.Forms.GroupBox
Me.btnExit = New System.Windows.Forms.Button
Me.ilButton = New System.Windows.Forms.ImageList(Me.components)
Me.btnCancel = New System.Windows.Forms.Button
Me.btnOK = New System.Windows.Forms.Button
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.pnlTop.SuspendLayout()
Me.pnlLeft.SuspendLayout()
Me.pnlName.SuspendLayout()
Me.GroupBox2.SuspendLayout()
Me.SuspendLayout()
'
'pnlTop
'
Me.pnlTop.Controls.Add(Me.Splitter2)
Me.pnlTop.Controls.Add(Me.lblCaption)
Me.pnlTop.Controls.Add(Me.PictureBox2)
Me.pnlTop.Controls.Add(Me.PictureBox1)
Me.pnlTop.Dock = System.Windows.Forms.DockStyle.Top
Me.pnlTop.Location = New System.Drawing.Point(0, 0)
Me.pnlTop.Name = "pnlTop"
Me.pnlTop.Size = New System.Drawing.Size(648, 48)
Me.pnlTop.TabIndex = 0
'
'Splitter2
'
Me.Splitter2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Splitter2.Dock = System.Windows.Forms.DockStyle.Bottom
Me.Splitter2.Enabled = False
Me.Splitter2.Location = New System.Drawing.Point(0, 45)
Me.Splitter2.Name = "Splitter2"
Me.Splitter2.Size = New System.Drawing.Size(648, 3)
Me.Splitter2.TabIndex = 3
Me.Splitter2.TabStop = False
'
'lblCaption
'
Me.lblCaption.Font = New System.Drawing.Font("隶书", 24.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.lblCaption.ForeColor = System.Drawing.SystemColors.Desktop
Me.lblCaption.Location = New System.Drawing.Point(72, 8)
Me.lblCaption.Name = "lblCaption"
Me.lblCaption.Size = New System.Drawing.Size(504, 32)
Me.lblCaption.TabIndex = 2
Me.lblCaption.Text = "lblCaption"
Me.lblCaption.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'PictureBox2
'
Me.PictureBox2.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.PictureBox2.Image = CType(resources.GetObject("PictureBox2.Image"), System.Drawing.Image)
Me.PictureBox2.Location = New System.Drawing.Point(592, 8)
Me.PictureBox2.Name = "PictureBox2"
Me.PictureBox2.Size = New System.Drawing.Size(32, 32)
Me.PictureBox2.TabIndex = 1
Me.PictureBox2.TabStop = False
'
'PictureBox1
'
Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Image)
Me.PictureBox1.Location = New System.Drawing.Point(16, 8)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(32, 32)
Me.PictureBox1.TabIndex = 0
Me.PictureBox1.TabStop = False
'
'pnlLeft
'
Me.pnlLeft.Controls.Add(Me.tvStudent)
Me.pnlLeft.Dock = System.Windows.Forms.DockStyle.Left
Me.pnlLeft.Location = New System.Drawing.Point(0, 48)
Me.pnlLeft.Name = "pnlLeft"
Me.pnlLeft.Size = New System.Drawing.Size(200, 381)
Me.pnlLeft.TabIndex = 1
'
'tvStudent
'
Me.tvStudent.BackColor = System.Drawing.SystemColors.Control
Me.tvStudent.BorderStyle = System.Windows.Forms.BorderStyle.None
Me.tvStudent.Dock = System.Windows.Forms.DockStyle.Fill
Me.tvStudent.ImageList = Me.ilTreeView
Me.tvStudent.Location = New System.Drawing.Point(0, 0)
Me.tvStudent.Name = "tvStudent"
Me.tvStudent.Nodes.AddRange(New System.Windows.Forms.TreeNode() {New System.Windows.Forms.TreeNode("学校", 0, 0)})
Me.tvStudent.Size = New System.Drawing.Size(200, 381)
Me.tvStudent.TabIndex = 1
'
'ilTreeView
'
Me.ilTreeView.ImageSize = New System.Drawing.Size(16, 16)
Me.ilTreeView.ImageStream = CType(resources.GetObject("ilTreeView.ImageStream"), System.Windows.Forms.ImageListStreamer)
Me.ilTreeView.TransparentColor = System.Drawing.Color.Transparent
'
'Splitter1
'
Me.Splitter1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Splitter1.Location = New System.Drawing.Point(200, 48)
Me.Splitter1.Name = "Splitter1"
Me.Splitter1.Size = New System.Drawing.Size(3, 381)
Me.Splitter1.TabIndex = 2
Me.Splitter1.TabStop = False
'
'pnlName
'
Me.pnlName.Controls.Add(Me.GroupBox2)
Me.pnlName.Controls.Add(Me.GroupBox1)
Me.pnlName.Dock = System.Windows.Forms.DockStyle.Fill
Me.pnlName.Location = New System.Drawing.Point(203, 48)
Me.pnlName.Name = "pnlName"
Me.pnlName.Size = New System.Drawing.Size(445, 381)
Me.pnlName.TabIndex = 3
'
'GroupBox2
'
Me.GroupBox2.Controls.Add(Me.btnExit)
Me.GroupBox2.Controls.Add(Me.btnCancel)
Me.GroupBox2.Controls.Add(Me.btnOK)
Me.GroupBox2.Dock = System.Windows.Forms.DockStyle.Bottom
Me.GroupBox2.Location = New System.Drawing.Point(0, 325)
Me.GroupBox2.Name = "GroupBox2"
Me.GroupBox2.Size = New System.Drawing.Size(445, 56)
Me.GroupBox2.TabIndex = 1
Me.GroupBox2.TabStop = False
'
'btnExit
'
Me.btnExit.Font = New System.Drawing.Font("华文新魏", 18.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.btnExit.ForeColor = System.Drawing.SystemColors.Desktop
Me.btnExit.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.btnExit.ImageIndex = 2
Me.btnExit.ImageList = Me.ilButton
Me.btnExit.Location = New System.Drawing.Point(304, 16)
Me.btnExit.Name = "btnExit"
Me.btnExit.Size = New System.Drawing.Size(120, 32)
Me.btnExit.TabIndex = 2
Me.btnExit.Text = "退出 "
Me.btnExit.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'ilButton
'
Me.ilButton.ImageSize = New System.Drawing.Size(32, 32)
Me.ilButton.ImageStream = CType(resources.GetObject("ilButton.ImageStream"), System.Windows.Forms.ImageListStreamer)
Me.ilButton.TransparentColor = System.Drawing.Color.Transparent
'
'btnCancel
'
Me.btnCancel.Font = New System.Drawing.Font("华文新魏", 18.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.btnCancel.ForeColor = System.Drawing.SystemColors.Desktop
Me.btnCancel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.btnCancel.ImageIndex = 1
Me.btnCancel.ImageList = Me.ilButton
Me.btnCancel.Location = New System.Drawing.Point(160, 16)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(120, 32)
Me.btnCancel.TabIndex = 1
Me.btnCancel.Text = "重置 "
Me.btnCancel.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'btnOK
'
Me.btnOK.Font = New System.Drawing.Font("华文新魏", 18.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.btnOK.ForeColor = System.Drawing.SystemColors.Desktop
Me.btnOK.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.btnOK.ImageIndex = 0
Me.btnOK.ImageList = Me.ilButton
Me.btnOK.Location = New System.Drawing.Point(16, 16)
Me.btnOK.Name = "btnOK"
Me.btnOK.Size = New System.Drawing.Size(120, 32)
Me.btnOK.TabIndex = 0
Me.btnOK.Text = "确认"
Me.btnOK.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'GroupBox1
'
Me.GroupBox1.Dock = System.Windows.Forms.DockStyle.Top
Me.GroupBox1.Location = New System.Drawing.Point(0, 0)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(445, 320)
Me.GroupBox1.TabIndex = 0
Me.GroupBox1.TabStop = False
'
'FormBase
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(648, 429)
Me.Controls.Add(Me.pnlName)
Me.Controls.Add(Me.Splitter1)
Me.Controls.Add(Me.pnlLeft)
Me.Controls.Add(Me.pnlTop)
Me.Name = "FormBase"
Me.Text = "学生注册"
Me.pnlTop.ResumeLayout(False)
Me.pnlLeft.ResumeLayout(False)
Me.pnlName.ResumeLayout(False)
Me.GroupBox2.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
Protected Overridable Sub InitTreeView()
Dim dtTemp As DataTable = DbBase.DataInterface.Execute4DS("select stu_num,name,profession_id,profession_name,profession_intro,college_id,college_name,college_intro from v_student").Tables(0)
Dim tnRoot As TreeNode = tvStudent.Nodes(0)
Dim iPreviousCollegeId As Integer = 0
Dim iPreviousProfessionId As Integer = 0
Dim tnCurrentCollege, tnCurrentProfession, tnStudent As TreeNode
For Each drTemp As DataRow In dtTemp.Rows
If drTemp(5) <> iPreviousCollegeId Then
tnCurrentCollege = New TreeNode(drTemp(6), 1, 1)
tnCurrentCollege.Tag = drTemp(5)
tnRoot.Nodes.Add(tnCurrentCollege)
End If
If drTemp(2) <> iPreviousProfessionId Then
tnCurrentProfession = New TreeNode(drTemp(3), 2, 2)
tnCurrentProfession = drTemp(2)
tnCurrentCollege.Nodes.Add(tnCurrentProfession)
End If
tnStudent = New TreeNode(drTemp(1), 3, 3)
tnStudent.Tag = drTemp(0)
tnCurrentProfession.Nodes.Add(tnStudent)
Next
End Sub
Protected Overridable Sub Reset()
'
End Sub
Protected Overridable Sub OK()
'
End Sub
Protected Overridable Sub Init()
'
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
OK()
End Sub
Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
Reset()
End Sub
Private Sub Form_OnLoad(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
InitTreeView()
Init()
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -