how do i highlight the selected item (in my case, a custom user control) in a flowlayoutpanel
Asked
Active
Viewed 5,794 times
3 Answers
2
FlowLayoutPanel is purely for layout - it has no concept of a "selected item". You might be able to add some logic to your UserControl which changes its colour when it receives focus (and changes back when it loses focus) but that would be independent of the layout control that's hosting it.

Matt Hamilton
- 200,371
- 61
- 386
- 320
-
somehow all the events are not firing on the usercontrol (enter and leave events for example). i have one main flowpanelcontrol which hosts a list of flowpanelcontrols. each of those hosts a list of user controls. i can't seem to get any of the events firing on those user controls – leora Apr 20 '09 at 05:26
-
Ah ok. I haven't played with UserControls for a long time but do remember having trouble with the Enter/Leave events. You may have to catch those events on the individual controls in the UserControl. – Matt Hamilton Apr 20 '09 at 05:28
0
I created a Bindable FlowLayoutPanel that included setting the selected index (with highlighting depending on the selected control. I posted it over on the code review site. Check it out and let me know if that works for you.

Community
- 1
- 1

SwDevMan81
- 48,814
- 22
- 151
- 184