C#: Detect when control scrolled into view

thesadguy

Active Member
Joined
Nov 29, 2008
Messages
70
Reaction score
0
I came right scrolling a control into view using
Code:
ScrollControlIntoView(Control ctrl)

Now I need to be able to do it the other way around.

I have a panel that is scrollable with a LOT of different controls in it. I need to be able to detect when a certain control is scrolled into view.

How can I do this? MSDN is PMS'ing atm, and I can't access the Scroll Events
 
It has to draw. Surely there is some type of event to do with drawing that is being triggered.
Oh wait, probably not, MS have probably masked it off entirely.

When this happens, I write stuff to a file from the other event. The parmeters of the "other event" can help you determine which event is actually firing.
 
I'm pretty sure an OnDraw event is fired when a control is drawn onto the panel. Try playing around with it...
 
I got it to fire off an appropriate event at an appropriate time. But now I'm having issues with the System.Windows.Forms.Panel.Find() method. It's just not returning any results. I've used it in the exact same way in many other places, but this one doesn't seem to like it :(

Oh, and now MSDN is PMS'ing again
 
Top
Sign up to the MyBroadband newsletter
X