943,692 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 619
  • VB.NET RSS
Jan 12th, 2009
0

About Combo BOx

Expand Post »
Good Morning Friends

I Am Using VB.net,I am doing code for search button & it's working for textboxes but not for combobox,accualy when it get any value so it shows on textbox by using

textbox1.text=ds.tables(0).rows(0).item(0)

& it shows but when i use

combobox.text =ds.tables(0).rows(0).item(0)

it doesn't show any value but when i wright

combobox.selecteditem==ds.tables(0).rows(0).item(0)

it works but execution get transfer because i have wroght code on comboboxselectedindexchanged

please give me any solution
Similar Threads
Reputation Points: 10
Solved Threads: 2
Light Poster
manoj_582033 is offline Offline
39 posts
since Nov 2008
Jan 12th, 2009
0

Re: About Combo BOx

Maybe that because there is already items in the combo, so Try to add the value you want to the combo first
vb.net Syntax (Toggle Plain Text)
  1. ComboBox.Items.Add(ds.tables(0).rows(0).item(0))
  2. ComboBox.Text = ds.tables(0).rows(0).item(0)

hth
Reputation Points: 69
Solved Threads: 19
Junior Poster
samir_ibrahim is offline Offline
155 posts
since Sep 2008
Jan 12th, 2009
0

Re: About Combo BOx

Thank's For This Code ,But when value becomes in combobox so the code of cobbobox_selected_indexchanged becomes execute & the code of that search button not execute.
Reputation Points: 10
Solved Threads: 2
Light Poster
manoj_582033 is offline Offline
39 posts
since Nov 2008
Jan 12th, 2009
0

Re: About Combo BOx

you could create a flag such as Dim bIsCodeNeedToRunTrue As Boolean and set to true when you want the code in the cobbobox_selected_indexchanged to be executed and to false when not.

or you could transfer the code from the cobbobox_selected_indexchanged to click() and this way you can control if you want to the code need to be run or no, if you change the combo by mouse the code will run , if you change the code programming, you can issue
vb.net Syntax (Toggle Plain Text)
  1. ComboBox.Text = ds.tables(0).rows(0).item(0)
  2. ComboBox.click() ' or remove this line for not executing the code

hth
Reputation Points: 69
Solved Threads: 19
Junior Poster
samir_ibrahim is offline Offline
155 posts
since Sep 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: ListView
Next Thread in VB.NET Forum Timeline: DataGridView ComboBoxColumn Scenario!! Help!!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC