الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

فورم إدخال البضاعة

بدأه djamel2020 في 16 سبتمبر 2014 · 3 رد · 754 مشاهدة · في ADO.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

Private Sub txtSerch_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtSerch.TextChanged
If cnn.State = ConnectionState.Open Then
cnn.Close()
End If
'On Error Resume Next
Dim Ask As String
cnn.Open()
AchatsBS.Filter = "N + Société + Dates + Montant like '%" + txtSerch.Text + "%'"
If DataGridView1.RowCount = 0 Then
Ask = MsgBox("Ce Fournisseur N'existe Pas, Voulez vous ajouter un?", MsgBoxStyle.YesNo)
If Ask = MsgBoxResult.Yes Then
txtSerch.Text = ""
frmsaisiedesfour.Show()
End If
End If
cnn.Close()
End Sub

 

لكود يشتغل لكن ليس عن طريق رقم الفاتورة إذ لو كتبت رقم الفاتورة في الـ txtSerch لا يعمل أما الباقي Société + Dates + Montant فيشتغل جيدا أود أن اعرف لماذا ممكن ؟post-284746-0-76154700-1410814750_thumb.

#2

طيب بدل الفلترة كيف أجعل كلما كتبت رقم الفاتورة في txtserch يتحدد السطر الموجدة فيه هذه الفاتورة

شكرا

#3

مرحبا

خلاص حليتها ولمن يريد الكود هو :

 Private Sub txtSerch_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtSerch.KeyPress
        If e.KeyChar = Chr(13) Then
            For i As Integer = 0 To DataGridView1.Rows.Count - 1
                If txtSerch.Text = DataGridView1.Rows(i).Cells(0).Value Then
                    DataGridView1.Rows(i).Selected = False
                    'DataGridView1.SelectionMode = DataGridViewSelectionMode.CellSelect
                    DataGridView1.Rows(i).DefaultCellStyle.BackColor = Color.DodgerBlue
                Else
                    DataGridView1.Rows(i).DefaultCellStyle.BackColor = Color.White
                End If
            Next
        End If
    End Sub

#4

مرحبا

خلاص حليتها ولمن يريد الكود هو :

 Private Sub txtSerch_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtSerch.KeyPress
        If e.KeyChar = Chr(13) Then
            For i As Integer = 0 To DataGridView1.Rows.Count - 1
                If txtSerch.Text = DataGridView1.Rows(i).Cells(0).Value Then
                    DataGridView1.Rows(i).Selected = False
                    'DataGridView1.SelectionMode = DataGridViewSelectionMode.CellSelect
                    DataGridView1.Rows(i).DefaultCellStyle.BackColor = Color.DodgerBlue
                Else
                    DataGridView1.Rows(i).DefaultCellStyle.BackColor = Color.White
                End If
            Next
        End If
    End Sub

مواضيع مشابهة