Find the scroll position
Posted on 2012-03-18
Asume you have a panel that sometimes is to wide for the available visibel area. When that happens a horisontal scrollbar apears at the bottom of the panel. The panels AutoScroll property is True.
Inside the panel there is another control that needs to always position itself in the middle of the visibel area of the panel when it is being scrolled.
I have been Googling around a bit and it seams this is quite complicated.
Can someone just give me a simple example code for how to obtain the Controls new X cordinate from the panel's current scroll position.
Please also state where this code should be added.
Or can this be done by some inbuilt functions like docking? (Docking does't seam to be able to do this.)