Disable AutoscrollPosition Change after setting focus

I

Ivo Kovacka

Hi,

I have a ScrollableControl (Panel) containing a couple of children. If
the control has set
Autoscroll to true and scrollbars are visible a scrolled away from (0,0)
position and I set
focus to this Panel, or I click in it, as a response the Panel is scrolled
to its (0,0) position.
Is there any way to NOT allow this scrolling?

Regards, ifko
 
H

Herfried K. Wagner [MVP]

* "Ivo Kovacka said:
I have a ScrollableControl (Panel) containing a couple of children. If
the control has set
Autoscroll to true and scrollbars are visible a scrolled away from (0,0)
position and I set
focus to this Panel, or I click in it, as a response the Panel is scrolled
to its (0,0) position.
Is there any way to NOT allow this scrolling?

The panel cannot get focus. If you are clicking a control, it will be
scrolled into view.
 
I

Ivo Kovacka

I derived class from the panel, where I set ControlStyle.Selectable to true
(that should
allow the control to receive the focus). But still, I doesn't work. Morever,
if I have only one child
that is not placed on the left-upper area of the panel, but somewhere else,
it doesn't
scroll to this child but still to (0,0) - is it a bug?.

I use this panel not only in runtime but also as RootDesigner View. In
Visual Studio, behavior
of my panel is as I expect. The panel is not scrolled, if click in it.

This is very WEIRD and that's why I am looking for the solution for my
runtime. If Visual Studio
has no problem to disable this for me not uselful "feature", how can I do it
itself?

Regards, ifko
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top