منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : كيف أربط Combobox معTextBox_TextChanged
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
بسم الله الرحمان الرحيم
السلام عليكم
أريد ربط Combobox مع TextBox_TextChanged لكي يكون لكل خيار من الكمبوبوكس كود محدد في textbox_textchanged
1

Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged

        repto.Clear()
        nota = New OleDbDataAdapter("select * from Table1 where Name1 like'%" & TextBox1.Text & "%'", con)
        nota.Fill(repto)
    End Sub

2
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
        repto.Clear()
        nota = New OleDbDataAdapter("select * from Table1 where Name2 like'%" & TextBox1.Text & "%'", con)
        nota.Fill(repto)
    End Sub
(16-05-20, 08:57 AM)paveldida كتب : [ -> ]
بسم الله الرحمان الرحيم
السلام عليكم
أريد ربط Combobox مع TextBox_TextChanged لكي يكون لكل خيار من الكمبوبوكس كود محدد في textbox_textchanged
1

Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged

        repto.Clear()
        nota = New OleDbDataAdapter("select * from Table1 where Name1 like'%" & TextBox1.Text & "%'", con)
        nota.Fill(repto)
    End Sub

2
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
        repto.Clear()
        nota = New OleDbDataAdapter("select * from Table1 where Name2 like'%" & TextBox1.Text & "%'", con)
        nota.Fill(repto)
    End Sub


وعليكم السلام و رحمة الله و بركاته

تستطيع استخدام قاعدة if 
و تقوم بربطها اما ب combobox selected index او combobox text

كود :
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged

If combobox1.text = "option1" then
       repto.Clear()
       nota = New OleDbDataAdapter("select * from Table1 where Name1 like'%" & TextBox1.Text & "%'", con)
       nota.Fill(repto)

else If combobox1.text = "option2" then

repto.Clear()
       nota = New OleDbDataAdapter("select * from Table1 where Name2 like'%" & TextBox1.Text & "%'", con)
       nota.Fill(repto)


end if

   End Sub
(16-05-20, 12:38 PM)WaeLx كتب : [ -> ]
(16-05-20, 08:57 AM)paveldida كتب : [ -> ]
بسم الله الرحمان الرحيم
السلام عليكم
أريد ربط Combobox مع TextBox_TextChanged لكي يكون لكل خيار من الكمبوبوكس كود محدد في textbox_textchanged
1

Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged

        repto.Clear()
        nota = New OleDbDataAdapter("select * from Table1 where Name1 like'%" & TextBox1.Text & "%'", con)
        nota.Fill(repto)
    End Sub

2
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
        repto.Clear()
        nota = New OleDbDataAdapter("select * from Table1 where Name2 like'%" & TextBox1.Text & "%'", con)
        nota.Fill(repto)
    End Sub


وعليكم السلام و رحمة الله و بركاته

تستطيع استخدام قاعدة if 
و تقوم بربطها اما ب combobox selected index او combobox text

كود :
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged

If combobox1.text = "option1" then
       repto.Clear()
       nota = New OleDbDataAdapter("select * from Table1 where Name1 like'%" & TextBox1.Text & "%'", con)
       nota.Fill(repto)

else If combobox1.text = "option2" then

repto.Clear()
       nota = New OleDbDataAdapter("select * from Table1 where Name2 like'%" & TextBox1.Text & "%'", con)
       nota.Fill(repto)


end if

   End Sub
بارك الله فيك أخي 
(16-05-20, 02:44 PM)paveldida كتب : [ -> ]
بارك الله فيك أخي 

و اياكم