منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
[كود] كيف أربط Combobox معTextBox_TextChanged - نسخة قابلة للطباعة

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



كيف أربط Combobox معTextBox_TextChanged - paveldida - 16-05-20

بسم الله الرحمان الرحيم
السلام عليكم
أريد ربط 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



RE: كيف أربط Combobox معTextBox_TextChanged - WaeLx - 16-05-20

(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



RE: كيف أربط Combobox معTextBox_TextChanged - paveldida - 16-05-20

(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
بارك الله فيك أخي 



RE: كيف أربط Combobox معTextBox_TextChanged - WaeLx - 16-05-20

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

و اياكم