📄 frmunpass.vb
字号:
Imports System.Drawing
Imports System.Drawing.Printing
Public Class FrmUnPass
Inherits System.Windows.Forms.Form
Dim updbset As DataSet
Dim fonthead As Font = Nothing
Dim fontcontext As Font = Nothing
Dim totalpage As Integer
Dim curpage As Integer
Dim totalline As Integer
Dim curline As Integer
Dim pagelinecount As Integer = 0
Dim printername As String = Nothing
#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 GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents GbDepartment As System.Windows.Forms.GroupBox
Friend WithEvents TvDep As System.Windows.Forms.TreeView
Friend WithEvents GbMarjoy As System.Windows.Forms.GroupBox
Friend WithEvents LbMarjoy As System.Windows.Forms.ListBox
Friend WithEvents GroupBox4 As System.Windows.Forms.GroupBox
Friend WithEvents combtesttime As System.Windows.Forms.ComboBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents combtestyear As System.Windows.Forms.ComboBox
Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
Friend WithEvents cmdOK As System.Windows.Forms.Button
Friend WithEvents cmdCancel As System.Windows.Forms.Button
Friend WithEvents mypd As System.Drawing.Printing.PrintDocument
Friend WithEvents ImageList1 As System.Windows.Forms.ImageList
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents cbprinter As System.Windows.Forms.ComboBox
Friend WithEvents Label2 As System.Windows.Forms.Label
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(FrmUnPass))
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.GbDepartment = New System.Windows.Forms.GroupBox
Me.TvDep = New System.Windows.Forms.TreeView
Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components)
Me.GbMarjoy = New System.Windows.Forms.GroupBox
Me.LbMarjoy = New System.Windows.Forms.ListBox
Me.GroupBox4 = New System.Windows.Forms.GroupBox
Me.Label2 = New System.Windows.Forms.Label
Me.cbprinter = New System.Windows.Forms.ComboBox
Me.combtesttime = New System.Windows.Forms.ComboBox
Me.Label1 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.combtestyear = New System.Windows.Forms.ComboBox
Me.DataGrid1 = New System.Windows.Forms.DataGrid
Me.cmdOK = New System.Windows.Forms.Button
Me.cmdCancel = New System.Windows.Forms.Button
Me.mypd = New System.Drawing.Printing.PrintDocument
Me.Button1 = New System.Windows.Forms.Button
Me.GroupBox1.SuspendLayout()
Me.GbDepartment.SuspendLayout()
Me.GbMarjoy.SuspendLayout()
Me.GroupBox4.SuspendLayout()
CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.GbDepartment)
Me.GroupBox1.Controls.Add(Me.GbMarjoy)
Me.GroupBox1.Dock = System.Windows.Forms.DockStyle.Left
Me.GroupBox1.Location = New System.Drawing.Point(0, 0)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(240, 479)
Me.GroupBox1.TabIndex = 2
Me.GroupBox1.TabStop = False
'
'GbDepartment
'
Me.GbDepartment.Controls.Add(Me.TvDep)
Me.GbDepartment.Location = New System.Drawing.Point(8, 16)
Me.GbDepartment.Name = "GbDepartment"
Me.GbDepartment.Size = New System.Drawing.Size(224, 296)
Me.GbDepartment.TabIndex = 0
Me.GbDepartment.TabStop = False
Me.GbDepartment.Text = "院系信息:"
'
'TvDep
'
Me.TvDep.Cursor = System.Windows.Forms.Cursors.Hand
Me.TvDep.Dock = System.Windows.Forms.DockStyle.Fill
Me.TvDep.ImageList = Me.ImageList1
Me.TvDep.ItemHeight = 34
Me.TvDep.Location = New System.Drawing.Point(3, 17)
Me.TvDep.Name = "TvDep"
Me.TvDep.Size = New System.Drawing.Size(218, 276)
Me.TvDep.TabIndex = 0
'
'ImageList1
'
Me.ImageList1.ImageSize = New System.Drawing.Size(30, 30)
Me.ImageList1.ImageStream = CType(resources.GetObject("ImageList1.ImageStream"), System.Windows.Forms.ImageListStreamer)
Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent
'
'GbMarjoy
'
Me.GbMarjoy.Controls.Add(Me.LbMarjoy)
Me.GbMarjoy.Location = New System.Drawing.Point(8, 320)
Me.GbMarjoy.Name = "GbMarjoy"
Me.GbMarjoy.Size = New System.Drawing.Size(224, 152)
Me.GbMarjoy.TabIndex = 1
Me.GbMarjoy.TabStop = False
Me.GbMarjoy.Text = "专业信息:"
'
'LbMarjoy
'
Me.LbMarjoy.Cursor = System.Windows.Forms.Cursors.Hand
Me.LbMarjoy.Dock = System.Windows.Forms.DockStyle.Fill
Me.LbMarjoy.ItemHeight = 12
Me.LbMarjoy.Location = New System.Drawing.Point(3, 17)
Me.LbMarjoy.Name = "LbMarjoy"
Me.LbMarjoy.Size = New System.Drawing.Size(218, 124)
Me.LbMarjoy.TabIndex = 0
'
'GroupBox4
'
Me.GroupBox4.Controls.Add(Me.Label2)
Me.GroupBox4.Controls.Add(Me.cbprinter)
Me.GroupBox4.Controls.Add(Me.combtesttime)
Me.GroupBox4.Controls.Add(Me.Label1)
Me.GroupBox4.Controls.Add(Me.Label3)
Me.GroupBox4.Controls.Add(Me.combtestyear)
Me.GroupBox4.Location = New System.Drawing.Point(248, 5)
Me.GroupBox4.Name = "GroupBox4"
Me.GroupBox4.Size = New System.Drawing.Size(448, 48)
Me.GroupBox4.TabIndex = 3
Me.GroupBox4.TabStop = False
Me.GroupBox4.Text = "考试时间:"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(240, 20)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(80, 16)
Me.Label2.TabIndex = 5
Me.Label2.Text = "选择打印机:"
'
'cbprinter
'
Me.cbprinter.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cbprinter.Location = New System.Drawing.Point(320, 16)
Me.cbprinter.Name = "cbprinter"
Me.cbprinter.Size = New System.Drawing.Size(120, 20)
Me.cbprinter.TabIndex = 4
'
'combtesttime
'
Me.combtesttime.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.combtesttime.Items.AddRange(New Object() {"1", "2"})
Me.combtesttime.Location = New System.Drawing.Point(144, 18)
Me.combtesttime.Name = "combtesttime"
Me.combtesttime.Size = New System.Drawing.Size(40, 20)
Me.combtesttime.TabIndex = 2
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(88, 20)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(56, 16)
Me.Label1.TabIndex = 1
Me.Label1.Text = "学年第"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(192, 20)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(40, 16)
Me.Label3.TabIndex = 3
Me.Label3.Text = "季"
'
'combtestyear
'
Me.combtestyear.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.combtestyear.Location = New System.Drawing.Point(16, 18)
Me.combtestyear.Name = "combtestyear"
Me.combtestyear.Size = New System.Drawing.Size(64, 20)
Me.combtestyear.TabIndex = 0
'
'DataGrid1
'
Me.DataGrid1.AlternatingBackColor = System.Drawing.Color.GhostWhite
Me.DataGrid1.BackColor = System.Drawing.Color.GhostWhite
Me.DataGrid1.BackgroundColor = System.Drawing.Color.Lavender
Me.DataGrid1.CaptionBackColor = System.Drawing.Color.RoyalBlue
Me.DataGrid1.CaptionForeColor = System.Drawing.Color.White
Me.DataGrid1.DataMember = ""
Me.DataGrid1.FlatMode = True
Me.DataGrid1.Font = New System.Drawing.Font("Tahoma", 8.0!)
Me.DataGrid1.ForeColor = System.Drawing.Color.MidnightBlue
Me.DataGrid1.GridLineColor = System.Drawing.Color.RoyalBlue
Me.DataGrid1.HeaderBackColor = System.Drawing.Color.MidnightBlue
Me.DataGrid1.HeaderFont = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Bold)
Me.DataGrid1.HeaderForeColor = System.Drawing.Color.Lavender
Me.DataGrid1.LinkColor = System.Drawing.Color.Teal
Me.DataGrid1.Location = New System.Drawing.Point(248, 64)
Me.DataGrid1.Name = "DataGrid1"
Me.DataGrid1.ParentRowsBackColor = System.Drawing.Color.Lavender
Me.DataGrid1.ParentRowsForeColor = System.Drawing.Color.MidnightBlue
Me.DataGrid1.ReadOnly = True
Me.DataGrid1.SelectionBackColor = System.Drawing.Color.Teal
Me.DataGrid1.SelectionForeColor = System.Drawing.Color.PaleGreen
Me.DataGrid1.Size = New System.Drawing.Size(448, 344)
Me.DataGrid1.TabIndex = 4
'
'cmdOK
'
Me.cmdOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.cmdOK.Location = New System.Drawing.Point(272, 432)
Me.cmdOK.Name = "cmdOK"
Me.cmdOK.Size = New System.Drawing.Size(104, 32)
Me.cmdOK.TabIndex = 5
Me.cmdOK.Text = "打 印 预 览"
'
'cmdCancel
'
Me.cmdCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.cmdCancel.Location = New System.Drawing.Point(568, 432)
Me.cmdCancel.Name = "cmdCancel"
Me.cmdCancel.Size = New System.Drawing.Size(104, 32)
Me.cmdCancel.TabIndex = 6
Me.cmdCancel.Text = "返 回"
'
'mypd
'
'
'Button1
'
Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button1.Location = New System.Drawing.Point(424, 432)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(104, 32)
Me.Button1.TabIndex = 7
Me.Button1.Text = "打 印"
'
'FrmUnPass
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(698, 479)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.cmdCancel)
Me.Controls.Add(Me.cmdOK)
Me.Controls.Add(Me.DataGrid1)
Me.Controls.Add(Me.GroupBox4)
Me.Controls.Add(Me.GroupBox1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False
Me.Name = "FrmUnPass"
Me.Text = "不及格学生信息打印"
Me.GroupBox1.ResumeLayout(False)
Me.GbDepartment.ResumeLayout(False)
Me.GbMarjoy.ResumeLayout(False)
Me.GroupBox4.ResumeLayout(False)
CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub FrmUnPass_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
MyDep.Initials()
CurDep.Initials()
MyMar.Initials()
CurMar.Initials()
MyStu.Initials()
CurStu.Initials()
MyGrade.Initials()
CurGrade.Initials()
MyDep.LoadDepNodesToTV(TvDep)
updbset = Nothing
Dim i As Integer
Dim yy As Integer
For i = 2000 To 2050
combtestyear.Items.Add(i.ToString)
Next
yy = Year(Now())
combtesttime.Text = 1
combtestyear.Text = yy.ToString
Dim pkInstalledPrinters As String
For i = 0 To PrinterSettings.InstalledPrinters.Count - 1
pkInstalledPrinters = PrinterSettings.InstalledPrinters.Item(i)
cbprinter.Items.Add(pkInstalledPrinters)
Next
If cbprinter.Items.Count = 0 Then
cmdOK.Enabled = False
Button1.Enabled = False
MsgBox("没有一台有效的打印机!", MsgBoxStyle.Exclamation, "大学语文考试系统V2.0")
Else
cbprinter.SelectedIndex = 0
printername = cbprinter.Items(cbprinter.SelectedIndex)
End If
End Sub
Private Sub FrmUnPass_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
MyDep.Initials()
CurDep.Initials()
MyMar.Initials()
CurMar.Initials()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -