Private Sub DataGridView1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.SelectionChanged
Dim str As String
With Me.DataGridView1
str = .Item(.CurrentCell.ColumnIndex, .CurrentCell.RowIndex).Value.ToString '获得datagridview中当前单元格中的已选择数据
str = Mid(str, 1, 3) '选择前面3位数,取得123
End With
End Sub