By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,098 Members | 1,405 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,098 IT Pros & Developers. It's quick & easy.

Selecting items from a combo box

P: 6
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?
Mar 25 '07 #1
Share this Question
Share on Google+
6 Replies


Expert 5K+
P: 8,434
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?
You haven't said what version of VB you're using.

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.
Mar 25 '07 #2

P: 6
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.
Mar 25 '07 #3

Expert 5K+
P: 8,434
Im using visual basic C# 2005.
Let me stop you there for a moment.

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.
Mar 25 '07 #4

P: 6
My fault, I meant to say Visual C# 2005
Mar 25 '07 #5

P: 6
I have the boxes popping up properly but I dont know how to fill them with the text entered from the user.
Mar 26 '07 #6

Expert 5K+
P: 8,434
I have the boxes popping up properly but I dont know how to fill them with the text entered from the user.
In VB6, I'd say by using the .AddItem method of the ComboBox control. In Visual C#, I have no idea.

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).
Mar 26 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.