I need to be able to have a user fill in an array, called payables, of 5 different possible types, and then select from a combo box one of those payables in the array. After being selected the user hits the edit button which then pops up the box with all of the text fields already filled in. But there is 5 different types of payables. Im not sure how to go about doing this, can anyone help?
Selecting items from a combo box
Collapse
X
-
Tags: None
-
You haven't said what version of VB you're using.Originally posted by johnnyfireI need to be able to have a user fill in an array, called payables, of 5 different possible types, and then select from a combo box one of those payables in the array. After being selected the user hits the edit button which then pops up the box with all of the text fields already filled in. But there is 5 different types of payables. Im not sure how to go about doing this, can anyone help?
But in VB6, to "select" an item in a combobox you just set the .Text property to that string. Note that this is different to the way it's done in a listbox. -
Im using visual basic C# 2005. But Im not completely understanding how to do that. There is a max of 25 items in the array and 5 different types(invoice, hourly, salaried, commission, base+commission ) that can go in the array. Say that the user fills in an invoice. The invoice number is then put in the combo box. Say then that the user fills out a salaried employee. That puts the ssn into the combo box. Then when the user chooses either one, it is suppose to bring up the specified box with the variables filled in that the user filled out earlier. Each type has different variables that are filled in.Comment
-
Let me stop you there for a moment.Originally posted by johnnyfireIm using visual basic C# 2005.
Visual Basic and C# are two different languages.
I think we need to clarify exactly what you are working with, or any advice we give will be pure guesswork.
However, consider this. If you have a combobox with a bunch of items in it, there are two possible ways to choose one. You will either set the "currently displayed text" property (whatever it is called in the language you're using). Or your language's equivalent of the ListIndex property, which moves the list to the specified position.Comment
-
-
I have the boxes popping up properly but I dont know how to fill them with the text entered from the user.Comment
-
In VB6, I'd say by using the .AddItem method of the ComboBox control. In Visual C#, I have no idea.Originally posted by johnnyfireI have the boxes popping up properly but I dont know how to fill them with the text entered from the user.
If you can't get the answers you need here, perhaps the people in the .Net forum would be able to help. Of possibly C++ (I don't know whether it's similar to C# or not).Comment
Comment