ComboBoxes

TommyEvans

Active member
Joined
Feb 19, 2010
Messages
39
Programming Experience
Beginner
I've never really used comboboxes before. I have it set so you can only select from a drop down menu (without being able to type.)

When a user selects a option from it, and presses "Go", then it will grab some information, and display the information in 3 labels.

How do I do this, and will I need to use a database for this? I've never used a database before, and kind of scared to learn, because of problems. :S


EDIT: I figured it out. Now another thing.
There is 16 items in my ComboBox. I need the text for them 16 to be divided into 3 colors. The first group is of 5, and need the text to be blue. The next group is of 5, and need them to be red. The last group is of 6 and I need them to be green.
I need the the text (when shown in the list) to be those colors. Is this even possible? :S
 
Last edited:
You can always use YourComboBox.SelectedItem to know what was selected. Be sure to check that YourComboBox.SelectedIndex is greater than -1, because -1 means nothing was selected.
 
There is 16 items in my ComboBox. I need the text for them 16 to be divided into 3 colors. The first group is of 5, and need the text to be blue. The next group is of 5, and need them to be red. The last group is of 6 and I need them to be green.
I need the the text (when shown in the list) to be those colors. Is this even possible?
ComboBox.DrawMode Property (System.Windows.Forms)
Select the OwnerDrawFixed option for this property, then you pretty much do same for DrawItem event as in the code sample.
 
Back
Top