How to avoid automatic scrolling on focus?

  • Thread starter Thread starter codymanix
  • Start date Start date
C

codymanix

I have a panel which is located in a AutoScroll-enabled panel. The
problem is when I click in the panel, the contining panel
automatically scrolls to position (0,0).
How can I get around this annoying behaviour?
 
have you tried implementing a method that gets invoked when the
control aquires focus, that "moves" the scrolled contained control to
show the clip of it that you desire?
 
have you tried implementing a method that gets invoked when the
control aquires focus, that "moves" the scrolled contained control to
show the clip of it that you desire?

Thank you. But howow can I do this? I tried the following but it didn't
work:

Point lastScrollPos;
protected override void OnGotFocus(EventArgs e)
{
this.Location = lastScrollPos ;
}

protected override void OnEnter(EventArgs e)
{
lastScrollPos = this.Location;
}
 
Back
Top