Creating a scrollable container control

R

Roger

I would like to create a custom container control which can scroll its
child controls. I know that the AutoScroll property of
ScrollableControl can mimic this functionality, but AutoScroll causes
some behavior which is EXTREMELY obnoxious to my users, and I haven't
been able to find a workaround.

Consequently, I would like to be able to scroll a control without using
the AutoScroll property.

Is there any way to accomplish this? I've created the appropriate
scrollbars, and now I just need to get the child controls to move. The
SetDisplayRectLocation() function sounded like exactly what I needed,
but it doesn't seem to work unless AutoScroll is enabled.
 
R

recoil

The best workaround to date that I know if is to put all of your
controls inside of a panel. The Panel will be the complete size needed.
Then add a vertical and horizontal scrollbar to your form. Then move
the panel based upon offsets of the scrollbars. It realy imho is not
the best solution but Microsoft in their infinite wisdom claim that
"this" is the most desired effect. I have yet to see a single instance
where it is but hey that's me.
 
R

Roger

Thanks for the suggestion. I've tried it, and it seems to work well
enough in this case. At least the controls aren't bouncing around
every time the focus changes, which was my major complaint with
AutoScroll.
 
G

Guest

Roger,
I'm having an issue which I think is exactly the same as you are
describing. To make sure, here's what I see: I have a panel with many
datagrids inside of it. Each time a datagrid is clicked on and recieves
focus, its position is moved to the top of the panel. Assuming this is the
same thing, can anyone confirm/deny that this is the desired functionality
with no option to turn off this automatic repositioning of controls inside a
panel once they recieve focus?

Tyson Kamp
 

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