frmdelhouse_building.vb

来自「由VB开发的基于SQL的小区物业管理系统」· VB 代码 · 共 31 行

VB
31
字号

Friend Class FrmDelHouse_Building
    Inherits System.Windows.Forms.Form

    Private Sub cmdExit_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs)
        Me.Close()

    End Sub

    Private Sub BtnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOK.Click
        If Me.TxtRoom.Text = "" Then
            DGVResult.DataSource = DBHouse.LoadHouse("HouseNo", Me.ComboBuilding.Text & "-" & Me.ComboUnit.Text & "-", "LIKE")
        Else
            DGVResult.DataSource = DBHouse.LoadHouse("HouseNo", Me.ComboBuilding.Text & "-" & Me.ComboUnit.Text & "-" & Me.TxtRoom.Text, "")
        End If

    End Sub

  

    Private Sub DGVResult_CellContentDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DGVResult.CellContentDoubleClick
        Dim DR As DialogResult
        DR = MsgBox("请确认是否删除 " & DGVResult.Rows(e.RowIndex).Cells(1).Value & " 这条记录", MsgBoxStyle.YesNo, "信息框")
        If DR = Windows.Forms.DialogResult.Yes Then
            DBHouse.DelHouse(DGVResult.Rows(e.RowIndex).Cells(0).Value)
        Else
            Exit Sub
        End If
        DGVResult.DataSource = DBHouse.LoadHouse("HouseNo", DGVResult.Rows(e.RowIndex).Cells(0).Value, "")
    End Sub
End Class

⌨️ 快捷键说明

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