enable/disable buttons based on ListView selection
- From: Brandon McCombs <none@xxxxxxxx>
- Date: Wed, 13 Jun 2007 23:09:15 -0400
Hello,
I have a form that contains a listview on the left side and a column of buttons on the right side. Only some of the buttons do I want enabled all the time. The other buttons should be enabled only if something is selected in the listview. That part specifically works but not very well. It seems that I can only get the buttons to disable if I click off the text of the items in the listview but still within about 10-20 pixels of the text. If I click way off to the right where there is still whitespace then I guess it isn't considered a click on the listview and no event is generated to disable the buttons.
In Java, clicking anywhere on a row in a list would register as an event on the list item but it seems with C# the boundary for what is considered the list item seems to be very small (and definitely doesn't extend across the entire width of the listview). By the way, I only have 1 column in the listview and I'm using the list view type (as opposed to details or large icons) if that matters. Any tips?
thanks
.
- Follow-Ups:
- RE: enable/disable buttons based on ListView selection
- From: Linda Liu [MSFT]
- Re: enable/disable buttons based on ListView selection
- From: Nicholas Paldino [.NET/C# MVP]
- RE: enable/disable buttons based on ListView selection
- Prev by Date: Re: need reference on "when to rewrite"
- Next by Date: Re: Web link in a windows form
- Previous by thread: Casting integer type to real state in a DetailsView
- Next by thread: Re: enable/disable buttons based on ListView selection
- Index(es):