تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
مشكلة في اسناد قيمة الى حقل !
#6
جرب هذا :
كود :
Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
        Try
            If DataGridView1.RowCount > 0 Then
                If DataGridView1.SelectedRows.Count > 0 Then
                    Dim dgvr As DataGridViewRow = DataGridView1.SelectedRows(0)
                    With dgvr
                        Me.TextBox1.Text = GetCellsValue(dgvr.Cells(0))
                        Me.TextBox2.Text = GetCellsValue(dgvr.Cells(1))
                        Me.TextBox3.Text = GetCellsValue(dgvr.Cells(2))
                    End With
                End If
            End If
        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Exclamation, Me.Text)
        End Try
    End Sub


    Private Function GetCellsValue(ByVal dgvCell As DataGridViewCell) As String
        Try
            If dgvCell.Value IsNot Nothing Then
                Return dgvCell.Value
            End If
        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Exclamation, Me.Text)
        End Try
    End Function
(وَقُل رَّبِّ زِدْنِي عِلْمًا)

الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
مشكلة في اسناد قيمة الى حقل ! - بواسطة kafi - 02-07-13, 12:35 AM
مشكلة في اسناد قيمة الى حقل ! - بواسطة kafi - 03-07-13, 02:21 AM
مشكلة في اسناد قيمة الى حقل ! - بواسطة kslawy - 03-07-13, 03:12 PM
مشكلة في اسناد قيمة الى حقل ! - بواسطة kafi - 04-07-13, 12:59 AM
مشكلة في اسناد قيمة الى حقل ! - بواسطة kafi - 04-07-13, 01:36 AM


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم