?? formcourseorder.vb
字號:
Imports CommonDB
Public Class FormCourseOrder
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 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 cmbCourse As System.Windows.Forms.ComboBox
Friend WithEvents lblCourse As System.Windows.Forms.Label
Friend WithEvents btnQuery As System.Windows.Forms.Button
Friend WithEvents dgCourseOrder As System.Windows.Forms.DataGrid
Friend WithEvents dgcStuNum As System.Windows.Forms.DataGridTextBoxColumn
Friend WithEvents dgcName As System.Windows.Forms.DataGridTextBoxColumn
Friend WithEvents dgcPoint As System.Windows.Forms.DataGridTextBoxColumn
Friend WithEvents dgtsCourseOrfer As System.Windows.Forms.DataGridTableStyle
Friend WithEvents btnExit As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(FormCourseOrder))
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.dgCourseOrder = New System.Windows.Forms.DataGrid
Me.dgtsCourseOrfer = New System.Windows.Forms.DataGridTableStyle
Me.dgcStuNum = New System.Windows.Forms.DataGridTextBoxColumn
Me.dgcName = New System.Windows.Forms.DataGridTextBoxColumn
Me.dgcPoint = New System.Windows.Forms.DataGridTextBoxColumn
Me.btnQuery = New System.Windows.Forms.Button
Me.cmbCourse = New System.Windows.Forms.ComboBox
Me.lblCourse = New System.Windows.Forms.Label
Me.btnExit = New System.Windows.Forms.Button
Me.pnlTop.SuspendLayout()
Me.GroupBox1.SuspendLayout()
CType(Me.dgCourseOrder, 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(392, 48)
Me.pnlTop.TabIndex = 4
'
'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(216, 32)
Me.lblCaption.TabIndex = 2
Me.lblCaption.Text = "課程成績排名"
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(328, 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.btnExit)
Me.GroupBox1.Controls.Add(Me.dgCourseOrder)
Me.GroupBox1.Controls.Add(Me.btnQuery)
Me.GroupBox1.Controls.Add(Me.cmbCourse)
Me.GroupBox1.Controls.Add(Me.lblCourse)
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(392, 341)
Me.GroupBox1.TabIndex = 8
Me.GroupBox1.TabStop = False
'
'dgCourseOrder
'
Me.dgCourseOrder.CaptionVisible = False
Me.dgCourseOrder.DataMember = ""
Me.dgCourseOrder.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.dgCourseOrder.Location = New System.Drawing.Point(8, 48)
Me.dgCourseOrder.Name = "dgCourseOrder"
Me.dgCourseOrder.Size = New System.Drawing.Size(376, 288)
Me.dgCourseOrder.TabIndex = 7
Me.dgCourseOrder.TableStyles.AddRange(New System.Windows.Forms.DataGridTableStyle() {Me.dgtsCourseOrfer})
'
'dgtsCourseOrfer
'
Me.dgtsCourseOrfer.DataGrid = Me.dgCourseOrder
Me.dgtsCourseOrfer.GridColumnStyles.AddRange(New System.Windows.Forms.DataGridColumnStyle() {Me.dgcStuNum, Me.dgcName, Me.dgcPoint})
Me.dgtsCourseOrfer.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.dgtsCourseOrfer.MappingName = ""
Me.dgtsCourseOrfer.ReadOnly = True
'
'dgcStuNum
'
Me.dgcStuNum.Format = ""
Me.dgcStuNum.FormatInfo = Nothing
Me.dgcStuNum.HeaderText = "學號"
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
'
'dgcPoint
'
Me.dgcPoint.Format = ""
Me.dgcPoint.FormatInfo = Nothing
Me.dgcPoint.HeaderText = "分數"
Me.dgcPoint.MappingName = ""
Me.dgcPoint.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(224, 16)
Me.btnQuery.Name = "btnQuery"
Me.btnQuery.Size = New System.Drawing.Size(75, 24)
Me.btnQuery.TabIndex = 6
Me.btnQuery.Text = " 查詢"
Me.btnQuery.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'cmbCourse
'
Me.cmbCourse.Location = New System.Drawing.Point(64, 16)
Me.cmbCourse.Name = "cmbCourse"
Me.cmbCourse.Size = New System.Drawing.Size(152, 20)
Me.cmbCourse.TabIndex = 3
Me.cmbCourse.Text = "請選擇或輸入課程名"
'
'lblCourse
'
Me.lblCourse.AutoSize = True
Me.lblCourse.Location = New System.Drawing.Point(16, 16)
Me.lblCourse.Name = "lblCourse"
Me.lblCourse.Size = New System.Drawing.Size(29, 17)
Me.lblCourse.TabIndex = 0
Me.lblCourse.Text = "課程"
'
'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(304, 16)
Me.btnExit.Name = "btnExit"
Me.btnExit.Size = New System.Drawing.Size(80, 24)
Me.btnExit.TabIndex = 8
Me.btnExit.Text = " 退出"
Me.btnExit.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'FormCourseOrder
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(392, 389)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.pnlTop)
Me.Name = "FormCourseOrder"
Me.Text = "課程成績排名"
Me.pnlTop.ResumeLayout(False)
Me.GroupBox1.ResumeLayout(False)
CType(Me.dgCourseOrder, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub FormCourseOrder_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'初始化下拉框
Me.cmbCourse.ValueMember = "id"
Me.cmbCourse.DisplayMember = "course_name"
Me.cmbCourse.DataSource = DbBase.DataInterface.Execute4DS("select id,course_name from v_curriculum2").Tables(0).DefaultView
'初始化數據網格
Me.dgCourseOrder.ReadOnly = True
Me.dgtsCourseOrfer.MappingName = "Table"
Me.dgcStuNum.MappingName = "stu_num"
Me.dgcName.MappingName = "student_name"
Me.dgcPoint.MappingName = "point"
End Sub
'查詢按鈕單擊
Private Sub btnQuery_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuery.Click
dgCourseOrder.DataSource = DbBase.DataInterface.Execute4DS("select stu_num,student_name,point from v_curriculum_schedule where id = " & cmbCourse.SelectedValue & " order by point desc").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
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -