'----DataGridView在設計點選內容時,可用DataGridView1.CurrentCellAddress.X(或Y)來找到所選中的列或欄
Private Sub DataGridView1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DataGridView1.MouseClick
TextBox1.Text = DataGridView1.Item(0, DataGridView1.CurrentCellAddress.Y).Value
TextBox2.Text = DataGridView1.Item(1, DataGridView1.CurrentCellAddress.Y).Value
DataGridView1.SendToBack()
End Sub
沒有留言:
張貼留言