frmdelstuent_name.vb

来自「通用学籍管理软件 vb开发access数据库的实例」· VB 代码 · 共 25 行

VB
25
字号
Public Class FrmDelStuent_Name

    Private Sub FrmDelStuent_Name_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        DGVResult.DataSource = DBStudent.LoadStudent("Name", Me.TxtName.Text, "")
    End Sub

    Private Sub DGVResult_CellContentDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DGVResult.CellContentDoubleClick
        If User.Mod2 = "可读" Then
            MsgBox("您无权写入记录!", MsgBoxStyle.Exclamation, "信息框")
            Exit Sub
        End If
        Dim DR As DialogResult
        DR = MsgBox("请确认是否删除 " & DGVResult.Rows(e.RowIndex).Cells(1).Value & " 这条记录", MsgBoxStyle.YesNo, "信息框")
        If DR = Windows.Forms.DialogResult.Yes Then
            DBStudent.DelStudent(DGVResult.Rows(e.RowIndex).Cells(0).Value)
        Else
            Exit Sub
        End If
        DGVResult.DataSource = DBStudent.LoadStudent("Name", Me.TxtName.Text, "")
    End Sub

    Private Sub BtnOK_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnOK.Click
        DGVResult.DataSource = DBStudent.LoadStudent("Name", Me.TxtName.Text, "")
    End Sub
End Class

⌨️ 快捷键说明

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