How can I find the reason for unexpected scrolling?

  • Thread starter Thread starter John Thomson
  • Start date Start date
J

John Thomson

I'm working on a custom control derived from
System.Windows.Forms.Panel (and hence from
System.Windows.Forms.ScrollableControl). At various
times, for example, whenever the application is
activated, it unexpectedly jumps to a particular scroll
position. I need to break at the point where this
scrolling happens, to see what is causing it.

There appears to be no event that fires when
AutoScrollPosition changes, nor a virtual method that can
be overidden. I tried setting a break point at the
disassembly line that is the implementation of the
set_AutoScrollPosition method, but apparently the problem
change is bypassing that.

Any suggestions much appreciated.
 
And yet there is more gaping holes in the libraries that you can fly a
rabbit flock of squirls through

MS sure left alot to be desired regarding the framework, its patchy at best
 
Yes, you're on the right track. The unexpected scrolling is always just
enough to make the last control I clicked visible.

But just focusing a different control at load time won't solve the
problem. I need to allow the user to scroll down to see more controls,
and don't particularly want to have to keep switching focus to some
visible control that the user hasn't clicked just to stop it scrolling
back all by itself!

Is there any way to turn this auto-scroll-to-show-focus-control behavior
off?
 
Yes, I confirmed your diagnosis. If I select a random visible control
every time I lay things out, the behavior is suppressed. I suspect this
will annoy my users, but not as much as the uncontrolled scrolling.

Is there any better solution?
 
Back
Top