⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmqueryobj.vb

📁 这个是本人写的题库系统,开发工具是vb.net.试题编辑,试卷编辑,可以在word中编辑试题.由于时间关系,很多功能需要细化.
💻 VB
字号:
Public Class frmqueryobj
    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 GroupBox1 As System.Windows.Forms.GroupBox
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents cmd_cancel As System.Windows.Forms.Button
    Friend WithEvents cmd_query As System.Windows.Forms.Button
    Friend WithEvents txt_opname As System.Windows.Forms.TextBox
    Friend WithEvents DateTimePicker1 As System.Windows.Forms.DateTimePicker
    Friend WithEvents comb_qobjtype As System.Windows.Forms.ComboBox
    Friend WithEvents Comb_chapter As System.Windows.Forms.ComboBox
    Friend WithEvents Comb_resultidx As System.Windows.Forms.ComboBox
    Friend WithEvents comb_oprate As System.Windows.Forms.ComboBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmqueryobj))
        Me.GroupBox1 = New System.Windows.Forms.GroupBox
        Me.comb_oprate = New System.Windows.Forms.ComboBox
        Me.txt_opname = New System.Windows.Forms.TextBox
        Me.Comb_resultidx = New System.Windows.Forms.ComboBox
        Me.comb_qobjtype = New System.Windows.Forms.ComboBox
        Me.Comb_chapter = New System.Windows.Forms.ComboBox
        Me.Label5 = New System.Windows.Forms.Label
        Me.Label4 = New System.Windows.Forms.Label
        Me.Label2 = New System.Windows.Forms.Label
        Me.Label3 = New System.Windows.Forms.Label
        Me.Label1 = New System.Windows.Forms.Label
        Me.DateTimePicker1 = New System.Windows.Forms.DateTimePicker
        Me.cmd_cancel = New System.Windows.Forms.Button
        Me.cmd_query = New System.Windows.Forms.Button
        Me.GroupBox1.SuspendLayout()
        Me.SuspendLayout()
        '
        'GroupBox1
        '
        Me.GroupBox1.Controls.Add(Me.comb_oprate)
        Me.GroupBox1.Controls.Add(Me.txt_opname)
        Me.GroupBox1.Controls.Add(Me.Comb_resultidx)
        Me.GroupBox1.Controls.Add(Me.comb_qobjtype)
        Me.GroupBox1.Controls.Add(Me.Comb_chapter)
        Me.GroupBox1.Controls.Add(Me.Label5)
        Me.GroupBox1.Controls.Add(Me.Label4)
        Me.GroupBox1.Controls.Add(Me.Label2)
        Me.GroupBox1.Controls.Add(Me.Label3)
        Me.GroupBox1.Controls.Add(Me.Label1)
        Me.GroupBox1.Controls.Add(Me.DateTimePicker1)
        Me.GroupBox1.Location = New System.Drawing.Point(40, 8)
        Me.GroupBox1.Name = "GroupBox1"
        Me.GroupBox1.Size = New System.Drawing.Size(272, 200)
        Me.GroupBox1.TabIndex = 0
        Me.GroupBox1.TabStop = False
        Me.GroupBox1.Text = "查询条件:"
        '
        'comb_oprate
        '
        Me.comb_oprate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.comb_oprate.Items.AddRange(New Object() {"<=", "<", ">=", ">", "="})
        Me.comb_oprate.Location = New System.Drawing.Point(88, 160)
        Me.comb_oprate.Name = "comb_oprate"
        Me.comb_oprate.Size = New System.Drawing.Size(48, 20)
        Me.comb_oprate.TabIndex = 19
        '
        'txt_opname
        '
        Me.txt_opname.Location = New System.Drawing.Point(104, 128)
        Me.txt_opname.MaxLength = 30
        Me.txt_opname.Name = "txt_opname"
        Me.txt_opname.Size = New System.Drawing.Size(152, 21)
        Me.txt_opname.TabIndex = 12
        Me.txt_opname.Text = ""
        '
        'Comb_resultidx
        '
        Me.Comb_resultidx.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.Comb_resultidx.Location = New System.Drawing.Point(104, 92)
        Me.Comb_resultidx.Name = "Comb_resultidx"
        Me.Comb_resultidx.Size = New System.Drawing.Size(152, 20)
        Me.Comb_resultidx.TabIndex = 11
        '
        'comb_qobjtype
        '
        Me.comb_qobjtype.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.comb_qobjtype.Location = New System.Drawing.Point(104, 60)
        Me.comb_qobjtype.Name = "comb_qobjtype"
        Me.comb_qobjtype.Size = New System.Drawing.Size(152, 20)
        Me.comb_qobjtype.TabIndex = 10
        '
        'Comb_chapter
        '
        Me.Comb_chapter.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.Comb_chapter.Location = New System.Drawing.Point(104, 28)
        Me.Comb_chapter.Name = "Comb_chapter"
        Me.Comb_chapter.Size = New System.Drawing.Size(152, 20)
        Me.Comb_chapter.TabIndex = 9
        '
        'Label5
        '
        Me.Label5.Location = New System.Drawing.Point(16, 164)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(72, 16)
        Me.Label5.TabIndex = 8
        Me.Label5.Text = "更新时间:"
        '
        'Label4
        '
        Me.Label4.Location = New System.Drawing.Point(16, 129)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(72, 16)
        Me.Label4.TabIndex = 7
        Me.Label4.Text = "录入者:"
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(16, 64)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(72, 16)
        Me.Label2.TabIndex = 6
        Me.Label2.Text = "题型:"
        '
        'Label3
        '
        Me.Label3.Location = New System.Drawing.Point(16, 96)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(72, 16)
        Me.Label3.TabIndex = 5
        Me.Label3.Text = "难度系数:"
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(16, 32)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(48, 16)
        Me.Label1.TabIndex = 1
        Me.Label1.Text = "章节:"
        '
        'DateTimePicker1
        '
        Me.DateTimePicker1.Location = New System.Drawing.Point(144, 160)
        Me.DateTimePicker1.Name = "DateTimePicker1"
        Me.DateTimePicker1.Size = New System.Drawing.Size(112, 21)
        Me.DateTimePicker1.TabIndex = 18
        '
        'cmd_cancel
        '
        Me.cmd_cancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.cmd_cancel.Location = New System.Drawing.Point(200, 224)
        Me.cmd_cancel.Name = "cmd_cancel"
        Me.cmd_cancel.Size = New System.Drawing.Size(80, 30)
        Me.cmd_cancel.TabIndex = 17
        Me.cmd_cancel.Text = "返   回"
        '
        'cmd_query
        '
        Me.cmd_query.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.cmd_query.Location = New System.Drawing.Point(72, 224)
        Me.cmd_query.Name = "cmd_query"
        Me.cmd_query.Size = New System.Drawing.Size(80, 30)
        Me.cmd_query.TabIndex = 16
        Me.cmd_query.Text = "确   定"
        '
        'frmqueryobj
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(346, 263)
        Me.Controls.Add(Me.cmd_cancel)
        Me.Controls.Add(Me.cmd_query)
        Me.Controls.Add(Me.GroupBox1)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.MaximizeBox = False
        Me.Name = "frmqueryobj"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "试题查询"
        Me.GroupBox1.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub cmd_cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd_cancel.Click
        Me.Close()
    End Sub

    Private Sub frmqueryobj_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        OBJQueryDbset = Nothing
        Dim objtypedbset As DataSet
        objtypedbset = MyObjtType.LoadObjTypes()
        Dim drow As DataRow
        comb_qobjtype.Items.Clear()

        If Not objtypedbset Is Nothing Then
            For Each drow In objtypedbset.Tables(0).Rows
                comb_qobjtype.Items.Add(drow.Item(1))
            Next
            comb_qobjtype.SelectedIndex = 0
        End If

        Comb_chapter.Items.Clear()
        Dim tmpchpdbset As DataSet
        tmpchpdbset = MyChp.GetChapterBySub(OpSubjt.SubjectID)
        If Not tmpchpdbset Is Nothing Then
            For Each drow In tmpchpdbset.Tables(0).Rows
                Comb_chapter.Items.Add(drow.Item(1))
            Next
            Comb_chapter.SelectedIndex = 0
        End If


        Comb_resultidx.Items.Clear()
        Dim i As Integer = 0
        For i = 1 To 5
            Comb_resultidx.Items.Add(Trim(Str(i)))
        Next
        comb_oprate.SelectedIndex = 0
        Comb_resultidx.SelectedIndex = 2
    End Sub

  

    Private Sub frmqueryobj_Deactivate(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Deactivate
        Me.Close()
    End Sub

    Private Sub cmd_query_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd_query.Click
        Dim tmpuser As New CObjectDetails
        tmpuser.Initials()
        MyChp.GetInfo(MakeStr(Comb_chapter.Text), CurSubjt.SubjectID)
        MyObjtType.GetInfo(MakeStr(comb_qobjtype.Text))
        OBJQueryDbset = tmpuser.QueryObj(MyChp.ChapterID, MyObjtType.ObjectTypeID, _
                        Int(Trim(Comb_resultidx.Text)), MakeStr(txt_opname.Text), _
                       MakeStr(comb_oprate.Text), DateTimePicker1.Value.Today)
        Me.Close()
    End Sub
End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -