Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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!) :)

Posted

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).

  • Leaders
Posted

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)

:)

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...