Windows Forms - C #

I wonder edit text / numbers that I have added to a listbox.

I to display the names in the listbox use this code
listBox1.DataSource = itemsfim;
To add one more name in the ListBox use:
itemsfim.Add ("Jorge - Portugal");

Now I would like to change in the visual listbox.
For example, take 2 clicks on the name and open a new form to change that name.

Can you give examples.
respects

Recommended Answers

All 5 Replies

I'm sure it could be done but it seems needlessly complicated. Have you considered using a combobox and putting the names in a droplist. That way reading the selected item is easy.

Well, I do not know that using the combobox.

Can you help what I asked? : S

A combobox can be filled just like the listbox and has the added advantage of using the selectionvaluechanged event whenever someone clicks on a line. If you set the dropdown style to simple the list will be visible like a textbox. Basically your trying to program a textbox to act like a combobox, which you've already got, and that will do what you're asking.

how to use combobox ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.