Click here to Skip to main content
15,890,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I just started with C# and WPF.

I use a listbox to change a value (1,2,3,4,5,6,....100)
Now I want to change the value manualy by entering the value via the keyboard.

e.g. the listbox item is at 4 and I want to use value 60.
Then I want to go with the mouse to the listbox, and enter the value 60.

At the moment I can select the value but cannot change it.

I guess it's just a property of the listbox, but I cannot find it.
Posted

The ListBox control enables you to display a list of items to the user that the user can select by clicking. A ListBox control can provide single or multiple selections using the SelectionMode property. The Items, SelectedItems, and SelectedIndices properties provide access to the three collections that are used by the ListBox.
 
Share this answer
 
I think the ListBox is not intended to do what you want (at least I don't think so), but you can do two things:

Add a TextBox and a "Add" Button for the non existant values and verify if the value is not in the list box (maybe you can build a new UserControl), or
You can search/build a ListBox with type/searching/add capabilities.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900