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!

Listbox full row selection

Status
Not open for further replies.

timmay3141

Programmer
Dec 3, 2002
468
US
I have a listbox and I want the full row to be selected when I select an item in it instead of just the text. I set FullRowSelect to true, but this doesn't seem to change anything. In some ways it seems to be behaving more like a list control than a list box (I'm used to doing this in C++, I'm new to C#). How can I make it actually select the full row?
 
Well, I tried to do what you want and I suceeded. First off, I think you mean to say ListView not ListBox because the ListBox does not have a FullRowSelect property. All I did to make it work was this.


1. Added a new ListView to my form
2. Change the following properties
FullRowSelect = True
View = Detail
3. Added a 3 columns, all with default values
4. Added a Main Item and 2 subitems


When I run the application it selects the entire row as expected.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top