?? formprofessionorder.vb
字號:
Imports CommonDB
Public Class FormProfessionOrder
Inherits System.Windows.Forms.Form
#Region " Windows 窗體設(shè)計器生成的代碼 "
Public Sub New()
MyBase.New()
'該調(diào)用是 Windows 窗體設(shè)計器所必需的。
InitializeComponent()
'在 InitializeComponent() 調(diào)用之后添加任何初始化
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 窗體設(shè)計器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下過程是 Windows 窗體設(shè)計器所必需的
'可以使用 Windows 窗體設(shè)計器修改此過程。
'不要使用代碼編輯器修改它。
Friend WithEvents pnlTop As System.Windows.Forms.Panel
Friend WithEvents lblCaption As System.Windows.Forms.Label
Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents btnQuery As System.Windows.Forms.Button
Friend WithEvents cmbProfession As System.Windows.Forms.ComboBox
Friend WithEvents cmbCollege As System.Windows.Forms.ComboBox
Friend WithEvents lblProfession As System.Windows.Forms.Label
Friend WithEvents lblCollege As System.Windows.Forms.Label
Friend WithEvents dgProfessionOrder As System.Windows.Forms.DataGrid
Friend WithEvents dgcStuNum As System.Windows.Forms.DataGridTextBoxColumn
Friend WithEvents dgcName As System.Windows.Forms.DataGridTextBoxColumn
Friend WithEvents dgcAverage As System.Windows.Forms.DataGridTextBoxColumn
Friend WithEvents btnExit As System.Windows.Forms.Button
Friend WithEvents dgtsProfessionOrder As System.Windows.Forms.DataGridTableStyle
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(FormProfessionOrder))
Me.pnlTop = New System.Windows.Forms.Panel
Me.lblCaption = New System.Windows.Forms.Label
Me.PictureBox2 = New System.Windows.Forms.PictureBox
Me.PictureBox1 = New System.Windows.Forms.PictureBox
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.dgProfessionOrder = New System.Windows.Forms.DataGrid
Me.dgtsProfessionOrder = New System.Windows.Forms.DataGridTableStyle
Me.dgcStuNum = New System.Windows.Forms.DataGridTextBoxColumn
Me.dgcName = New System.Windows.Forms.DataGridTextBoxColumn
Me.dgcAverage = New System.Windows.Forms.DataGridTextBoxColumn
Me.btnQuery = New System.Windows.Forms.Button
Me.cmbProfession = New System.Windows.Forms.ComboBox
Me.cmbCollege = New System.Windows.Forms.ComboBox
Me.lblProfession = New System.Windows.Forms.Label
Me.lblCollege = New System.Windows.Forms.Label
Me.btnExit = New System.Windows.Forms.Button
Me.pnlTop.SuspendLayout()
Me.GroupBox1.SuspendLayout()
CType(Me.dgProfessionOrder, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'pnlTop
'
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(288, 48)
Me.pnlTop.TabIndex = 5
'
'lblCaption
'
Me.lblCaption.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.lblCaption.Font = New System.Drawing.Font("隸書", 15.75!, 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(88, 8)
Me.lblCaption.Name = "lblCaption"
Me.lblCaption.Size = New System.Drawing.Size(112, 32)
Me.lblCaption.TabIndex = 2
Me.lblCaption.Text = "專業(yè)排名"
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(224, 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(32, 8)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(32, 32)
Me.PictureBox1.TabIndex = 0
Me.PictureBox1.TabStop = False
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.dgProfessionOrder)
Me.GroupBox1.Controls.Add(Me.btnQuery)
Me.GroupBox1.Controls.Add(Me.cmbProfession)
Me.GroupBox1.Controls.Add(Me.cmbCollege)
Me.GroupBox1.Controls.Add(Me.lblProfession)
Me.GroupBox1.Controls.Add(Me.lblCollege)
Me.GroupBox1.Controls.Add(Me.btnExit)
Me.GroupBox1.Dock = System.Windows.Forms.DockStyle.Fill
Me.GroupBox1.Location = New System.Drawing.Point(0, 48)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(288, 413)
Me.GroupBox1.TabIndex = 9
Me.GroupBox1.TabStop = False
'
'dgProfessionOrder
'
Me.dgProfessionOrder.CaptionVisible = False
Me.dgProfessionOrder.DataMember = ""
Me.dgProfessionOrder.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.dgProfessionOrder.Location = New System.Drawing.Point(8, 80)
Me.dgProfessionOrder.Name = "dgProfessionOrder"
Me.dgProfessionOrder.Size = New System.Drawing.Size(272, 328)
Me.dgProfessionOrder.TabIndex = 7
Me.dgProfessionOrder.TableStyles.AddRange(New System.Windows.Forms.DataGridTableStyle() {Me.dgtsProfessionOrder})
'
'dgtsProfessionOrder
'
Me.dgtsProfessionOrder.DataGrid = Me.dgProfessionOrder
Me.dgtsProfessionOrder.GridColumnStyles.AddRange(New System.Windows.Forms.DataGridColumnStyle() {Me.dgcStuNum, Me.dgcName, Me.dgcAverage})
Me.dgtsProfessionOrder.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.dgtsProfessionOrder.MappingName = ""
Me.dgtsProfessionOrder.ReadOnly = True
'
'dgcStuNum
'
Me.dgcStuNum.Format = ""
Me.dgcStuNum.FormatInfo = Nothing
Me.dgcStuNum.HeaderText = "學(xué)號"
Me.dgcStuNum.MappingName = ""
Me.dgcStuNum.Width = 75
'
'dgcName
'
Me.dgcName.Format = ""
Me.dgcName.FormatInfo = Nothing
Me.dgcName.HeaderText = "姓名"
Me.dgcName.MappingName = ""
Me.dgcName.Width = 75
'
'dgcAverage
'
Me.dgcAverage.Format = ""
Me.dgcAverage.FormatInfo = Nothing
Me.dgcAverage.HeaderText = "平均成績"
Me.dgcAverage.MappingName = ""
Me.dgcAverage.Width = 75
'
'btnQuery
'
Me.btnQuery.Image = CType(resources.GetObject("btnQuery.Image"), System.Drawing.Image)
Me.btnQuery.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
Me.btnQuery.Location = New System.Drawing.Point(200, 48)
Me.btnQuery.Name = "btnQuery"
Me.btnQuery.TabIndex = 6
Me.btnQuery.Text = " 查詢"
Me.btnQuery.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'cmbProfession
'
Me.cmbProfession.Location = New System.Drawing.Point(40, 48)
Me.cmbProfession.Name = "cmbProfession"
Me.cmbProfession.Size = New System.Drawing.Size(152, 20)
Me.cmbProfession.TabIndex = 5
Me.cmbProfession.Text = "請選擇..."
'
'cmbCollege
'
Me.cmbCollege.Location = New System.Drawing.Point(40, 24)
Me.cmbCollege.Name = "cmbCollege"
Me.cmbCollege.Size = New System.Drawing.Size(152, 20)
Me.cmbCollege.TabIndex = 4
Me.cmbCollege.Text = "請選擇..."
'
'lblProfession
'
Me.lblProfession.AutoSize = True
Me.lblProfession.Location = New System.Drawing.Point(8, 56)
Me.lblProfession.Name = "lblProfession"
Me.lblProfession.Size = New System.Drawing.Size(29, 17)
Me.lblProfession.TabIndex = 2
Me.lblProfession.Text = "專業(yè)"
'
'lblCollege
'
Me.lblCollege.AutoSize = True
Me.lblCollege.Location = New System.Drawing.Point(8, 32)
Me.lblCollege.Name = "lblCollege"
Me.lblCollege.Size = New System.Drawing.Size(29, 17)
Me.lblCollege.TabIndex = 1
Me.lblCollege.Text = "學(xué)院"
'
'btnExit
'
Me.btnExit.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btnExit.Font = New System.Drawing.Font("宋體", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.btnExit.ForeColor = System.Drawing.SystemColors.ControlText
Me.btnExit.Image = CType(resources.GetObject("btnExit.Image"), System.Drawing.Image)
Me.btnExit.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
Me.btnExit.Location = New System.Drawing.Point(200, 24)
Me.btnExit.Name = "btnExit"
Me.btnExit.TabIndex = 10
Me.btnExit.Text = " 退出"
Me.btnExit.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'FormProfessionOrder
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(288, 461)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.pnlTop)
Me.Name = "FormProfessionOrder"
Me.Text = "FormProfessionOrder"
Me.pnlTop.ResumeLayout(False)
Me.GroupBox1.ResumeLayout(False)
CType(Me.dgProfessionOrder, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
'窗體Load事件,進行各下拉框初始化
Private Sub FormProfessionOrder_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'初始化學(xué)院下拉框
Me.cmbCollege.ValueMember = "id"
Me.cmbCollege.DisplayMember = "name"
Me.cmbCollege.DataSource = DbBase.DataInterface.Execute4DS("select id,name from college").Tables(0).DefaultView
'初始化專業(yè)下拉框
Me.cmbProfession.ValueMember = "id"
Me.cmbProfession.DisplayMember = "name"
'初始化數(shù)據(jù)網(wǎng)格
Me.dgtsProfessionOrder.MappingName = "Table"
Me.dgcName.MappingName = "student_name"
Me.dgcStuNum.MappingName = "stu_num"
Me.dgcAverage.MappingName = "average_point"
End Sub
'改變“學(xué)院”下拉框選項時,更新“專業(yè)”下拉框顯示項目
Private Sub cmbCollege_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbCollege.SelectedIndexChanged
Me.cmbProfession.DataSource = DbBase.DataInterface.Execute4DS("select id,name from profession where college_id = " & cmbCollege.SelectedValue).Tables(0).DefaultView
End Sub
'查詢按鈕單擊,調(diào)用Achievement.StudentOrder()方法查詢專業(yè)內(nèi)學(xué)生排名
Private Sub btnQuery_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnQuery.Click
Me.dgProfessionOrder.DataSource = Achievement.StudentOrder(cmbProfession.SelectedValue).Tables(0).DefaultView
End Sub
'退出按鈕單擊
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
End Class
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -