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

📄 frmknowlegeman.vb

📁 这个是本人写的题库系统,开发工具是vb.net.试题编辑,试卷编辑,可以在word中编辑试题.由于时间关系,很多功能需要细化.
💻 VB
📖 第 1 页 / 共 3 页
字号:
        Me.tv_chapter.ImageList = Me.ImageList1
        Me.tv_chapter.ItemHeight = 34
        Me.tv_chapter.Location = New System.Drawing.Point(8, 64)
        Me.tv_chapter.Name = "tv_chapter"
        Me.tv_chapter.Size = New System.Drawing.Size(224, 376)
        Me.tv_chapter.TabIndex = 0
        '
        'GroupBox3
        '
        Me.GroupBox3.Controls.Add(Me.lbl_knowleg)
        Me.GroupBox3.Controls.Add(Me.Label8)
        Me.GroupBox3.Controls.Add(Me.Panel3)
        Me.GroupBox3.Controls.Add(Me.tv_knowleg)
        Me.GroupBox3.Location = New System.Drawing.Point(504, 8)
        Me.GroupBox3.Name = "GroupBox3"
        Me.GroupBox3.Size = New System.Drawing.Size(240, 568)
        Me.GroupBox3.TabIndex = 2
        Me.GroupBox3.TabStop = False
        Me.GroupBox3.Text = "知识点信息:"
        '
        'lbl_knowleg
        '
        Me.lbl_knowleg.Location = New System.Drawing.Point(24, 40)
        Me.lbl_knowleg.Name = "lbl_knowleg"
        Me.lbl_knowleg.Size = New System.Drawing.Size(208, 16)
        Me.lbl_knowleg.TabIndex = 5
        '
        'Label8
        '
        Me.Label8.Location = New System.Drawing.Point(8, 16)
        Me.Label8.Name = "Label8"
        Me.Label8.Size = New System.Drawing.Size(72, 16)
        Me.Label8.TabIndex = 4
        Me.Label8.Text = "当前知识点:"
        '
        'Panel3
        '
        Me.Panel3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.Panel3.Controls.Add(Me.cmd_knowdelete)
        Me.Panel3.Controls.Add(Me.cmd_knowmodify)
        Me.Panel3.Controls.Add(Me.cmd_knowadd)
        Me.Panel3.Controls.Add(Me.Label3)
        Me.Panel3.Controls.Add(Me.txt_knowleg)
        Me.Panel3.Location = New System.Drawing.Point(8, 448)
        Me.Panel3.Name = "Panel3"
        Me.Panel3.Size = New System.Drawing.Size(224, 112)
        Me.Panel3.TabIndex = 1
        '
        'cmd_knowdelete
        '
        Me.cmd_knowdelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.cmd_knowdelete.Location = New System.Drawing.Point(152, 64)
        Me.cmd_knowdelete.Name = "cmd_knowdelete"
        Me.cmd_knowdelete.Size = New System.Drawing.Size(60, 30)
        Me.cmd_knowdelete.TabIndex = 14
        Me.cmd_knowdelete.Text = "删 除"
        '
        'cmd_knowmodify
        '
        Me.cmd_knowmodify.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.cmd_knowmodify.Location = New System.Drawing.Point(84, 64)
        Me.cmd_knowmodify.Name = "cmd_knowmodify"
        Me.cmd_knowmodify.Size = New System.Drawing.Size(60, 30)
        Me.cmd_knowmodify.TabIndex = 13
        Me.cmd_knowmodify.Text = "修 改"
        '
        'cmd_knowadd
        '
        Me.cmd_knowadd.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.cmd_knowadd.Location = New System.Drawing.Point(16, 64)
        Me.cmd_knowadd.Name = "cmd_knowadd"
        Me.cmd_knowadd.Size = New System.Drawing.Size(60, 30)
        Me.cmd_knowadd.TabIndex = 12
        Me.cmd_knowadd.Text = "添 加"
        '
        'Label3
        '
        Me.Label3.Location = New System.Drawing.Point(64, 8)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(90, 16)
        Me.Label3.TabIndex = 10
        Me.Label3.Text = "知识点名称:"
        Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'txt_knowleg
        '
        Me.txt_knowleg.Location = New System.Drawing.Point(32, 32)
        Me.txt_knowleg.Name = "txt_knowleg"
        Me.txt_knowleg.Size = New System.Drawing.Size(160, 21)
        Me.txt_knowleg.TabIndex = 9
        Me.txt_knowleg.Text = ""
        Me.txt_knowleg.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'tv_knowleg
        '
        Me.tv_knowleg.ImageList = Me.ImageList1
        Me.tv_knowleg.ItemHeight = 34
        Me.tv_knowleg.Location = New System.Drawing.Point(8, 64)
        Me.tv_knowleg.Name = "tv_knowleg"
        Me.tv_knowleg.Size = New System.Drawing.Size(224, 376)
        Me.tv_knowleg.TabIndex = 0
        '
        'frmknowlegeman
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(746, 583)
        Me.Controls.Add(Me.GroupBox3)
        Me.Controls.Add(Me.GroupBox2)
        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 = "frmknowlegeman"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "知识点设置"
        Me.GroupBox1.ResumeLayout(False)
        Me.Panel1.ResumeLayout(False)
        Me.GroupBox2.ResumeLayout(False)
        Me.Panel2.ResumeLayout(False)
        Me.GroupBox3.ResumeLayout(False)
        Me.Panel3.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub frmknowlegeman_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        MySubjt.LoadSubjects(tv_subject)
        CurSubjt.Initials()
        MySubjt.Initials()
        CurChp.Initials()
        MyChp.Initials()
        MyKnow.Initials()
        CurKnow.Initials()
    End Sub
    Private Sub tv_subject_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles tv_subject.MouseDown
        tv_subject.SelectedNode = tv_subject.GetNodeAt(e.X, e.Y)
        If Not tv_subject.SelectedNode Is Nothing Then
            If CurSubjt.SubjectName = tv_subject.SelectedNode.Text Then
                Exit Sub
            End If
            MySubjt.GetInfo(MakeStr(tv_subject.SelectedNode.Text))
            CurSubjt.Equal(MySubjt)
            tv_chapter.Nodes.Clear()
            CurChp.Initials()
            tv_knowleg.Nodes.Clear()
            CurKnow.Initials()
            lbl_chapter.Text = ""
            lbl_knowleg.Text = ""
            CurChp.LoadNodesBySubject(tv_chapter, CurSubjt.SubjectID)
            txt_subject.Text = MySubjt.SubjectName
        End If
        lbl_subject.Text = CurSubjt.SubjectName
    End Sub

    Private Sub cmd_subadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd_subadd.Click
        If Trim(txt_subject.Text) = "" Then
            MsgBox("课程名称不能为空", MsgBoxStyle.Exclamation, "翼清测试题库系统V1.0")
            txt_subject.Focus()
            Exit Sub
        End If
        If MySubjt.IsInDB(MakeStr(txt_subject.Text)) Then
            MsgBox("课程名称[" & txt_subject.Text & "]已经存在", MsgBoxStyle.Exclamation, "翼清测试题库系统V1.0")
            txt_subject.Text = ""
            txt_subject.Focus()
            Exit Sub
        End If
        MySubjt.SubjectID = MySubjt.GetNewID()
        MySubjt.SubjectName = MakeStr(txt_subject.Text)
        If MySubjt.InsertDB() Then
            CurSubjt.Equal(MySubjt)
            lbl_subject.Text = CurSubjt.SubjectName
            tv_chapter.Nodes.Clear()
            CurChp.Initials()
            tv_knowleg.Nodes.Clear()
            CurKnow.Initials()
            txt_subject.Text = CurSubjt.SubjectName
            lbl_chapter.Text = ""
            lbl_knowleg.Text = ""
            tv_subject.SelectedNode = InsertTreeNode(tv_subject, CurSubjt.SubjectName)
            tv_subject.SelectedNode.ImageIndex = 0
            tv_subject.SelectedNode.SelectedImageIndex = 0
        Else
            Exit Sub
        End If
    End Sub


    Private Sub cmd_submodify_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd_submodify.Click
        If CurSubjt.SubjectID <= 0 Then
            MsgBox("请选择科目", MsgBoxStyle.Exclamation, "翼清测试题库系统V1.0")
            Exit Sub
        End If
        If Trim(txt_subject.Text) = "" Then
            MsgBox("课程名称不能为空", MsgBoxStyle.Exclamation, "翼清测试题库系统V1.0")
            txt_subject.Focus()
            Exit Sub
        End If
        If CurSubjt.SubjectID <= 0 Then
            txt_subject.Text = ""
            Exit Sub
        End If
        If Trim(txt_subject.Text) = CurSubjt.SubjectName Then
            MsgBox("成功更新", MsgBoxStyle.Exclamation, "翼清测试题库系统V1.0")
            Exit Sub
        End If
        If MySubjt.IsInDB(MakeStr(txt_subject.Text)) Then
            MsgBox("课程名称[" & MySubjt.SubjectName & "]已经存在", MsgBoxStyle.Exclamation, "翼清测试题库系统V1.0")
            txt_subject.Text = ""
            txt_subject.Focus()
            Exit Sub
        End If
        MySubjt.SubjectID = CurSubjt.SubjectID
        MySubjt.SubjectName = MakeStr(txt_subject.Text)
        If MySubjt.Modify() Then
            CurSubjt.SubjectName = MySubjt.SubjectName
            tv_subject.SelectedNode.Text = CurSubjt.SubjectName
            lbl_subject.Text = CurSubjt.SubjectName
            txt_subject.Text = CurSubjt.SubjectName
        Else
            MySubjt.SubjectName = CurSubjt.SubjectName
            txt_subject.Text = CurSubjt.SubjectName
            Exit Sub
        End If
    End Sub

    Private Sub cmd_subdelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd_subdelete.Click
        If CurSubjt.SubjectID <= 0 Then
            Exit Sub
        End If
        If MySubjt.HaveChapter(CurSubjt.SubjectID) Then
            If MsgBox("您是否真的要删除课程[" & MySubjt.SubjectName & "]已经存在章节,知识点,试题等孩子节点,如果您真的删除后信息无法恢复,请您谨慎处理", _
             MsgBoxStyle.YesNo + MsgBoxStyle.Exclamation, "翼清测试题库系统V1.0") = MsgBoxResult.Yes Then
                MySubjt.SubjectID = CurSubjt.SubjectID
                Dim dbset As DataSet
                Dim drow As DataRow
                dbset = MyChp.GetChapterBySub(MySubjt.SubjectID)
                If Not dbset Is Nothing Then
                    For Each drow In dbset.Tables(0).Rows
                        Dim tmpdbset As DataSet
                        Dim tmpdrow As DataRow
                        tmpdbset = MyObjt.GetObjDetailByChp(drow.Item("ChapterID"))
                        If Not tmpdbset Is Nothing Then
                            For Each tmpdrow In tmpdbset.Tables(0).Rows
                                MyobjKD.DeleteByObj(tmpdrow.Item("ObjectID"))
                            Next
                        End If
                        MyObjt.DeleteObjByChp(drow.Item("ChapterID"))
                        MyKnow.DeleteByChpID(drow.Item("ChapterID"))
                    Next
                    MyChp.DeleteChpBySub(MySubjt.SubjectID)
                End If
                If MySubjt.Delete() Then
                    Dim tnode As TreeNode
                    tnode = tv_subject.SelectedNode
                    tv_subject.Nodes.Remove(tnode)
                    tv_chapter.Nodes.Clear()
                    tv_knowleg.Nodes.Clear()
                    CurSubjt.Initials()
                    MySubjt.Initials()
                    lbl_knowleg.Text = ""
                    lbl_chapter.Text = ""
                    txt_knowleg.Text = ""
                    txt_chapter.Text = ""
                    lbl_subject.Text = ""
                    txt_subject.Text = ""
                    CurChp.Initials()
                    CurKnow.Initials()
                End If
            Else
                Exit Sub
            End If
        Else
            If MsgBox("是否删除课程名称[" & CurSubjt.SubjectName & "]", MsgBoxStyle.YesNo + MsgBoxStyle.Exclamation, "翼清测试题库系统V1.0") = MsgBoxResult.Yes Then
                MySubjt.SubjectID = CurSubjt.SubjectID
                If MySubjt.Delete() Then
                    Dim tnode As TreeNode
                    tnode = tv_subject.SelectedNode
                    tv_subject.Nodes.Remove(tnode)
                    CurSubjt.Initials()
                    MySubjt.Initials()
                    lbl_subject.Text = ""
                    txt_subject.Text = ""
                    CurSubjt.Initials()
                    MySubjt.Initials()
                End If
            End If
        End If
    End Sub

    Private Sub tv_chapter_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles tv_chapter.MouseDown
        tv_chapter.SelectedNode = tv_chapter.GetNodeAt(e.X, e.Y)

⌨️ 快捷键说明

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