What's the Windows Form Equivalent to the ASP Drop down list

I want to download a list of names and reference numbers, display the names to the User, and from his selection read the associated reference number, but I can't see the Windows Form to do this.

I'm missing something pretty basic and deserve contempt, but would appreicate being enlightened.Idea
Thanks in advance.

[388 byte] By [WhoKnows] at [2007-12-16]
# 1
The answer is so obvious that I wonder whether or not I'm missing something. The control (I think) your looking for is a ComboBox. Though, I suspect there's more to this question...
dkocur2 at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 2
The problem I'm having with a combo box is as follows: I've set it's DataSource property to a DataSet that includes a Topics.Name and a Topics.TopicID column. I set the DisplayMember and ValueMember properties of the Combo box to those two columns respectively.

The combo box displays the topic name correctly, but when I access the ValueMember, I get returned the literal "Topics.TopicID" instead of the number itself.

If you could tell me how to rectify that, I'd relly apprecate it.

WhoKnows at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 3
You would have to post your code for us to see the problem. From what you describe, it ought to work. I suspect something is not quite right about the ValueMember of the binding. Probably the ToString() method is being invoked, and it is returning the literal you see instead of useful information.
durstin at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 4
Following you suggestion of a binding problem, I re-configured the data adapter and dataset and now everything is working fine. I don't know what it was that I changed that rectified the problem.

Thanks for the directionBig Smile

WhoKnows at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms General...