Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display selected item in listbox.

Status
Not open for further replies.

CSharpBeginner

Programmer
Joined
May 10, 2004
Messages
4
Location
US
I have a weird issue that seems like it would be easy to fix.

I have a listbox that I make large enough to show 4 items at a time. Once the user selects the item they want, I reduce the size to show just one record - however, the record they selected does not show. How do I make it so that when the listbox is reduced, the highlighted/selected item is the only one that shows?

Let me know if you need to see my code, its C# winforms.

Thanks.
 
I moved the code for changing the size of the listbox from SelectedIndexChanged to the Click event and now it works like I wanted. :-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top