منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
عن اداة datagridview - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم لغة الفيجوال بيسك VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=182)
+--- قسم : قسم اسئلة VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=183)
+--- الموضوع : عن اداة datagridview (/showthread.php?tid=22022)



عن اداة datagridview - sweem - 07-10-17

اريد عند الضغط على انتر في cell معينة يتم تنفيذ كود 
انا الكود اللي درته هذا بس ينزل للسطر اللي في الاسفل قبل ما اينفذ اللي نبيه الرجاء الرد ضروري ضروري 
 Private Sub DataGridView1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles DataGridView1.KeyPress
        If DataGridView1.RowCount > 0 And e.KeyChar = Chr(13) Then
                Dim a As Integer
                Dim d As Double
                Dim sql1 As String = "select * from mstor where num=" & DataGridView1.CurrentRow.Cells("num").Value & ""
                adpfa1 = New SqlDataAdapter(sql1, Connect)
                adpfa1.Fill(dsfa, sql1)
                dtfa1 = dsfa.Tables(sql1)
                a = DataGridView1.CurrentRow.Cells("qu").Value
                If dtfa1.Rows.Count > 0 Then
                    d = a * Val(dtfa1.Rows(0).Item("sss"))
                    DataGridView1.CurrentRow.Cells("g").Value = Val(d.ToString)
                    del()
                    add()
                End If
            End If
    End Sub


RE: عن اداة datagridview - أحمد النجار - 07-10-17

خلي الاجراء في حدث Cellendedit