thechris Posted February 26, 2006 Posted February 26, 2006 Hi, In VB I have a combobox with a default text value, "options". When the form is dropped down, naturally, an item can be selected from the combo box. A procedure is called on SelectedIndexChanged. However, nothing is shown in the text area of the combo box after an option has been selected. I want it to display the value the user has selected, but it is just blank :p What am I missing? It's worth mentioning that I'm pretty new to VB, and programming in general. Any help would be greatly appreciated, thanks in advance. - Chris. (ps: This is my first post, but I'll definitely be hanging around here!) :) Quote
Leaders snarfblam Posted February 26, 2006 Leaders Posted February 26, 2006 Do you handle the SelectedIndexChanged event? If so, what do you have for code? Quote [sIGPIC]e[/sIGPIC]
thechris Posted February 26, 2006 Author Posted February 26, 2006 Hi, thanks for your reply. My code for the event is as follows: Private Sub ComDay_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComDay.SelectedIndexChanged Call CalculateDays(ComDay.Text, ComDay2.Text, ComDay3.Text) End Sub I think this is what you require :p It is the ComDay combo box with which the text is not present. The procedure called is a calculation of the parameters passed to it (and does not return a value). Quote
Leaders Iceplug Posted February 27, 2006 Leaders Posted February 27, 2006 So, what do you have for code inside of the CalculateDays? Also, as a quick test, find the value of ComDay.Text immediately before the call to CalculateDays. Hint: MessageBox.Show(ComDay.Text) :) Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
thechris Posted March 1, 2006 Author Posted March 1, 2006 Fixed :p I was so sure it was nothing to do with the procedure (and posting is my last resort after fixing all the problems I can). Turns out the were some unwanted .Items.Clear in there. Deleted them, and what do you know, it fixed the problem! D'oh! Sorry about that. Thanks a lot for your help anyway! - Chris. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.