?? frmclass.vb
字號:
Imports SchoolManage
Imports System
Imports System.Data
Imports System.Data.SqlClient
Public Class FrmClass
Inherits System.Windows.Forms.Form
Private sqlConn As SqlConnection
Private sqlComm As SqlCommand
Private daDate As SqlDataAdapter
Private dsData As DataSet
Private flag As Int32 '標明添加還是修改
Private strSelect As String '查詢框是否有值
Private tableNum As Int32 '查詢框沒值則為0,有值則為1
#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 Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents txtID As System.Windows.Forms.TextBox
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents txtName As System.Windows.Forms.TextBox
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents cmbTeacher As System.Windows.Forms.ComboBox
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents cmbCourse As System.Windows.Forms.ComboBox
Friend WithEvents btnSelect As System.Windows.Forms.Button
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents txtTime As System.Windows.Forms.TextBox
Friend WithEvents btnExit As System.Windows.Forms.Button
Friend WithEvents btnSave As System.Windows.Forms.Button
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents btnCancel As System.Windows.Forms.Button
Friend WithEvents btnDelete As System.Windows.Forms.Button
Friend WithEvents btnUpdate As System.Windows.Forms.Button
Friend WithEvents btnAdd As System.Windows.Forms.Button
Friend WithEvents dgDate As System.Windows.Forms.DataGrid
Friend WithEvents cmbDepartment As System.Windows.Forms.ComboBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.txtID = New System.Windows.Forms.TextBox
Me.Label3 = New System.Windows.Forms.Label
Me.txtName = New System.Windows.Forms.TextBox
Me.Label4 = New System.Windows.Forms.Label
Me.cmbDepartment = New System.Windows.Forms.ComboBox
Me.Label5 = New System.Windows.Forms.Label
Me.cmbTeacher = New System.Windows.Forms.ComboBox
Me.Label6 = New System.Windows.Forms.Label
Me.cmbCourse = New System.Windows.Forms.ComboBox
Me.btnSelect = New System.Windows.Forms.Button
Me.Label7 = New System.Windows.Forms.Label
Me.txtTime = New System.Windows.Forms.TextBox
Me.dgDate = New System.Windows.Forms.DataGrid
Me.btnExit = New System.Windows.Forms.Button
Me.btnSave = New System.Windows.Forms.Button
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.btnCancel = New System.Windows.Forms.Button
Me.btnDelete = New System.Windows.Forms.Button
Me.btnUpdate = New System.Windows.Forms.Button
Me.btnAdd = New System.Windows.Forms.Button
CType(Me.dgDate, System.ComponentModel.ISupportInitialize).BeginInit()
Me.GroupBox1.SuspendLayout()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Font = New System.Drawing.Font("黑體", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label1.Location = New System.Drawing.Point(152, 8)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(112, 32)
Me.Label1.TabIndex = 0
Me.Label1.Text = "班級管理"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(16, 52)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(66, 16)
Me.Label2.TabIndex = 1
Me.Label2.Text = "班級編號:"
'
'txtID
'
Me.txtID.Location = New System.Drawing.Point(100, 48)
Me.txtID.Name = "txtID"
Me.txtID.Size = New System.Drawing.Size(92, 21)
Me.txtID.TabIndex = 2
Me.txtID.Text = ""
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(16, 124)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(66, 16)
Me.Label3.TabIndex = 3
Me.Label3.Text = "班級名稱:"
'
'txtName
'
Me.txtName.Location = New System.Drawing.Point(100, 119)
Me.txtName.Name = "txtName"
Me.txtName.Size = New System.Drawing.Size(92, 21)
Me.txtName.TabIndex = 4
Me.txtName.Text = ""
'
'Label4
'
Me.Label4.Location = New System.Drawing.Point(16, 88)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(66, 16)
Me.Label4.TabIndex = 5
Me.Label4.Text = "所屬系部:"
'
'cmbDepartment
'
Me.cmbDepartment.Location = New System.Drawing.Point(100, 84)
Me.cmbDepartment.Name = "cmbDepartment"
Me.cmbDepartment.Size = New System.Drawing.Size(92, 20)
Me.cmbDepartment.TabIndex = 6
'
'Label5
'
Me.Label5.Location = New System.Drawing.Point(222, 88)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(66, 16)
Me.Label5.TabIndex = 7
Me.Label5.Text = "班主任:"
'
'cmbTeacher
'
Me.cmbTeacher.Location = New System.Drawing.Point(304, 86)
Me.cmbTeacher.Name = "cmbTeacher"
Me.cmbTeacher.Size = New System.Drawing.Size(92, 20)
Me.cmbTeacher.TabIndex = 8
'
'Label6
'
Me.Label6.Location = New System.Drawing.Point(222, 124)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(66, 16)
Me.Label6.TabIndex = 9
Me.Label6.Text = "專業:"
'
'cmbCourse
'
Me.cmbCourse.Location = New System.Drawing.Point(304, 120)
Me.cmbCourse.Name = "cmbCourse"
Me.cmbCourse.Size = New System.Drawing.Size(92, 20)
Me.cmbCourse.TabIndex = 10
'
'btnSelect
'
Me.btnSelect.Location = New System.Drawing.Point(222, 50)
Me.btnSelect.Name = "btnSelect"
Me.btnSelect.Size = New System.Drawing.Size(110, 22)
Me.btnSelect.TabIndex = 11
Me.btnSelect.Text = "查詢"
'
'Label7
'
Me.Label7.Location = New System.Drawing.Point(16, 154)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(66, 16)
Me.Label7.TabIndex = 12
Me.Label7.Text = "課程安排:"
'
'txtTime
'
Me.txtTime.Location = New System.Drawing.Point(90, 154)
Me.txtTime.Multiline = True
Me.txtTime.Name = "txtTime"
Me.txtTime.Size = New System.Drawing.Size(306, 82)
Me.txtTime.TabIndex = 13
Me.txtTime.Text = ""
'
'dgDate
'
Me.dgDate.DataMember = ""
Me.dgDate.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.dgDate.Location = New System.Drawing.Point(16, 252)
Me.dgDate.Name = "dgDate"
Me.dgDate.ReadOnly = True
Me.dgDate.Size = New System.Drawing.Size(336, 210)
Me.dgDate.TabIndex = 14
'
'btnExit
'
Me.btnExit.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btnExit.Location = New System.Drawing.Point(374, 440)
Me.btnExit.Name = "btnExit"
Me.btnExit.Size = New System.Drawing.Size(60, 24)
Me.btnExit.TabIndex = 17
Me.btnExit.Text = "退出"
'
'btnSave
'
Me.btnSave.Location = New System.Drawing.Point(374, 410)
Me.btnSave.Name = "btnSave"
Me.btnSave.Size = New System.Drawing.Size(60, 24)
Me.btnSave.TabIndex = 16
Me.btnSave.Text = "保存"
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.btnCancel)
Me.GroupBox1.Controls.Add(Me.btnDelete)
Me.GroupBox1.Controls.Add(Me.btnUpdate)
Me.GroupBox1.Controls.Add(Me.btnAdd)
Me.GroupBox1.Location = New System.Drawing.Point(362, 252)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(78, 148)
Me.GroupBox1.TabIndex = 15
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "GroupBox1"
'
'btnCancel
'
Me.btnCancel.Location = New System.Drawing.Point(14, 114)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(56, 24)
Me.btnCancel.TabIndex = 3
Me.btnCancel.Text = "取消"
'
'btnDelete
'
Me.btnDelete.Location = New System.Drawing.Point(14, 84)
Me.btnDelete.Name = "btnDelete"
Me.btnDelete.Size = New System.Drawing.Size(56, 24)
Me.btnDelete.TabIndex = 2
Me.btnDelete.Text = "刪除"
'
'btnUpdate
'
Me.btnUpdate.Location = New System.Drawing.Point(14, 54)
Me.btnUpdate.Name = "btnUpdate"
Me.btnUpdate.Size = New System.Drawing.Size(56, 24)
Me.btnUpdate.TabIndex = 1
Me.btnUpdate.Text = "更改"
'
'btnAdd
'
Me.btnAdd.Location = New System.Drawing.Point(14, 24)
Me.btnAdd.Name = "btnAdd"
Me.btnAdd.Size = New System.Drawing.Size(56, 24)
Me.btnAdd.TabIndex = 0
Me.btnAdd.Text = "添加"
'
'FrmClass
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(452, 473)
Me.Controls.Add(Me.btnExit)
Me.Controls.Add(Me.btnSave)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.dgDate)
Me.Controls.Add(Me.txtTime)
Me.Controls.Add(Me.Label7)
Me.Controls.Add(Me.btnSelect)
Me.Controls.Add(Me.cmbCourse)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.cmbTeacher)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.cmbDepartment)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.txtName)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.txtID)
Me.Controls.Add(Me.Label2)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -