If e.KeyCode = Keys.Delete Then
e.Cancel = True
If QQClient.Ready = False Then \'如果QQClient没有启动,则禁止编辑
PopMessage("必须启动QQClient,才能编辑此表数据!","提示",PopIconEnum.Infomation,5)
Return
End If
If e.Table.TopRow = e.Table.BottomRow Then Return
For i As Integer = e.Table.TopRow To e.Table.BottomRow
Dim r As Row = e.Table.Rows(i)
If r.DataRow.RowState <> DataRowState.Added Then \'新增行正常编辑
Dim key As String = e.Table.DataTable.Name & ":" & r("_Identify")
If tbrk.Contains(key) = False Then \'如果 本人之前已经编辑此行,则正常编辑
Dim msg = QQClient.SendWait("?#" & Key & "#?",5) \'向服务器发送请求编辑信息
If msg = "OK" Then \'如果服务器返回OK
tbrk.Add(key) \'在本地登记正在编辑此行
ElseIf msg > "" Then \'否则显示服务器返回的信息,并取消编辑
\'PopMessage("无法编辑此行,因为:" & vbcrlf & msg ,"提示",PopIconEnum.Infomation,5)
Continue For
Else \'如果服务器没有返回信息,则取消编辑
\'PopMessage("因服务器无响应,无法编辑此行!" ,"提示",PopIconEnum.Infomation,5)
Continue For
End If
End If
End If
For j As Integer = e.Table.LeftCol To e.Table.RightCol
r(j) = Nothing
Next
Next
End If