tags:

views:

23

answers:

1

If I have a windows forms ScrollablePanel-based container and populate it with enough controls so that its actual size exceeds its view size, I can invoke the function ScrollIntoView to ensure Control X is in view.

But when the user scrolls the panel manually how can I get notification when Control X enters and exits the view?

+1  A: 

You could use the Rectangle.Contains method with something like this:

if(container.Bounds.Contains(ControlX.Bounds))
{
   // I'm in the zone chief
}

This would go in the scroll event of the container control.

SwDevMan81