Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey Codeproject,

I currently have a panel within a panel, the panel inside the other one (named TilePanel), can change its size and therefore gets its own scrollbars (AutoScroll property set to true). I've put it inside another panel (Alignment Panel) so I could center it properly without messing up any of the drawing code or other events.

Now my question is, is it possible for me to remove the auto scrolls from the TilePanel, and instead, put those auto scrolls in the bigger panel that encompasses it?

Here's an example I made in paint.

For what it's worth I've also published the AlignmentPanel on pastebin.

Best Regards,
- Eds

What I have tried:

I've tried setting the tilepanel autoscroll to false, then I created a new horizontal scrollbar and a vertical scrollbar, and added those to the alignment panel. Then when those are scrolled I set the autoscroll values of the tilepanel to the new scrollbars values - however, it seems to bug and spazz out doing this, maybe I'm missing something, not sure.
Posted
Updated 18-May-17 7:16am
v3

1 solution

 
Share this answer
 
Comments
It's Eddie! 18-May-17 13:19pm    
Thanks for the links Rick. The problem is that these assume that the contained control is too big - however, my TilePanel is always smaller than the containment panel. The reason the TilePanel can autoscroll is because it contains a button that's always on the edge of the size (it's a TileControl, so it has a really big grid inside of it.)

It looks pretty ugly with the tiny scroll bars inside of it, so that's why I'm trying to get a way to put new scroll bars on the containing panel instead of the TilePanel (think of it like in photoshop, where the scroll bars are on the side, as opposed to on the picturebox/image/editing field.)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900