About Combo BOx

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2008
Posts: 34
Reputation: manoj_582033 is an unknown quantity at this point 
Solved Threads: 0
manoj_582033 manoj_582033 is offline Offline
Light Poster

About Combo BOx

 
0
  #1
Jan 12th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 148
Reputation: samir_ibrahim is on a distinguished road 
Solved Threads: 16
samir_ibrahim's Avatar
samir_ibrahim samir_ibrahim is offline Offline
Junior Poster

Re: About Combo BOx

 
0
  #2
Jan 12th, 2009
Maybe that because there is already items in the combo, so Try to add the value you want to the combo first
  1. ComboBox.Items.Add(ds.tables(0).rows(0).item(0))
  2. ComboBox.Text = ds.tables(0).rows(0).item(0)

hth
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 34
Reputation: manoj_582033 is an unknown quantity at this point 
Solved Threads: 0
manoj_582033 manoj_582033 is offline Offline
Light Poster

Re: About Combo BOx

 
0
  #3
Jan 12th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 148
Reputation: samir_ibrahim is on a distinguished road 
Solved Threads: 16
samir_ibrahim's Avatar
samir_ibrahim samir_ibrahim is offline Offline
Junior Poster

Re: About Combo BOx

 
0
  #4
Jan 12th, 2009
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
  1. ComboBox.Text = ds.tables(0).rows(0).item(0)
  2. ComboBox.click() ' or remove this line for not executing the code

hth
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC