Windows Develop Bookmark and Share   
 index > Windows Forms General > Scroll to control w/ Focus
 

Scroll to control w/ Focus

It looks as though the default behavior of ScrollableControls is to change their scroll position when activated so that the child control that has focus is within view.

Is there a way to turn off this behavior?

ajp9760584  Friday, January 18, 2008 3:58 PM

Hi Ajp,

I am not sure if I understand you completely. Can you provide a detailed description of the problem you encountered? For example, can you provide the detailed steps to help us reproduce this problem locally?

Additionally, does setting ScrollableControl.AutoScroll property to false help you out?

Thanks.


Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Jeffrey Tan - MSFT  Monday, January 21, 2008 6:50 AM

Hey Jeffrey, thanks for responding. Let me see if I can do a better job of explaining:

Let's say I have a form with AutoScroll set to true. I've also placed two text-boxes on the form, one near the top, and the other out of view at the bottom of the form (so the vertical scrollbar is visible).

When I run the app, the first textbox (at the top) has focus.I scroll down so that the second text-box is visible (but I don't give it focus). Now... I give some other window focus (maybe another application). When I return to the window in which I scrolled down, it immediately scrolls so that the first text-box (near the top) is visible, since it is the control with focus on my form.

I'm looking for a way to prevent that behavior. ie. the form would retain its vertical scroll position when it's activated regardless of which control on it's surface has focus.

Thanks,

A

ajp9760584  Tuesday, January 22, 2008 3:32 PM

You can use google to search for other answers

Custom Search

More Threads

• Gradient BackColor
• NonModal form is not working in C# .NET
• How to fast refresh a control to handle large amount of data?
• to add mouse over and out feature to a picture
• Pls hlp urgent.Accessing one .net exe from another, assume both are running
• datastore for my application?
• Help with TextBox Validation using a function
• Displaying Good Quality Graphics in a large Simulation
• Http Download & Resume
• How can I get more information on why VS2008 is crashing