2010-03-15 9 views

답변

10

이 샘플 코드를 확인하십시오. 중요한 것은 이벤트의 DataGridViewCellEventArgs 매개 변수를 사용하여 클릭 된 셀의 RowIndexColumnIndex을 찾는 것입니다.

Private Sub DataGridView1_CellClick(ByVal sender As System.Object, _ 
            ByVal e As DataGridViewCellEventArgs) _ 
            Handles DataGridView1.CellClick 
    MsgBox(DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value) 
End Sub 
+0

P.S를 호출 할 수 있습니다 : 당신은 아마 더 답변을 얻을 것이다 당신이 실제로 당신을 가장 도움이 답 표시 귀찮게하는 경우 - 평판 당신을 응답하는 유일한 보상입니다. –

0

당신은 버튼에서

Dim y As String = DataGridView1.CurrentCell.Value 

If IsDBNull(y) Then 

Else 

TextBox1.Text = y 

End If 
관련 문제