19-03-22, 08:14 AM
(آخر تعديل لهذه المشاركة : 19-03-22, 08:15 AM {2} بواسطة حسين ادريس.)
(18-03-22, 07:16 PM)safralfahd كتب :وجزاك(11-03-22, 07:05 AM)حسين ادريس كتب : اتفضل الكود ي غالىجزاك الله خير الجزاء
مطلوب داتا جريد فيو1 بالفروم رقم 1
ومديول
انسخ هذا الكود
كود :
Imports System.Data.OleDb
Public Class Form1
Dim dt_cust As New DataTable
Dim da As OleDbDataAdapter
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
da = New OleDbDataAdapter("select * from mm", con)
da.Fill(dt_cust)
DataGridView1.DataSource = dt_cust
End Sub
Private Sub DataGridView1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles DataGridView1.KeyDown
If e.KeyCode = Keys.Enter Then
e.SuppressKeyPress = True
'e.SuppressKeyPress = False
Dim iCol = DataGridView1.CurrentCell.ColumnIndex
Dim iRow = DataGridView1.CurrentCell.RowIndex
If iCol = DataGridView1.Columns.Count - 1 Then
If iRow < DataGridView1.Rows.Count - 1 Then
DataGridView1.CurrentCell = DataGridView1(0, iRow + 1)
End If
Else
DataGridView1.CurrentCell = DataGridView1(iCol + 1, iRow)
End If
Dim cmd As New OleDbCommandBuilder(da)
Try
da.Update(dt_cust)
con.Close()
MsgBox("تمت التعديل بنجاح")
Catch ex As Exception
MsgBox(ex.Message)
Exit Sub
End Try
End If
End Sub
ممكن تعمل نموذج بهذا الكود لو سمحت
اسف جدا على التاخير فى الرد
اتفضل المثال
انا شغال بنسخه 86 لو نسختك 32 ممكن تغير من داخل الفيجوال ستديو2010

