当我按下F9,光标可能在任何位置时,如何在datagridview单元格的鼠标光标位置插入字符GG?
答案 0 :(得分:0)
Dim c As Control = Me.dgvDetail.EditingControl
If c IsNot Nothing AndAlso TypeOf c Is TextBox Then
selectionStart = CType(c, TextBox).SelectionStart
End If Dim text As String = CStr(Me.dgvDetail.CurrentCell.Value)
Me.dgvDetail.CurrentCell.Value = text.Insert(selectionStart, "GG")