Scroll one panel with another panels scrollbar

sarthemaker

Active member
Joined
Sep 4, 2009
Messages
36
Programming Experience
5-10
I have two panels, and I want them to both scroll horizontally with one scroll bar, but I only want one of them to scroll vertically. So if I have a large panel on autoscroll, it works fine for that panel, but I have another smaller panel above that, could I make the smaller panel scroll horizontally with the larger panel's horizontal scrollbar?
 
Try this, in the large panel use the scroll event, and as long as they have the same maximum you won't run into an error, else you should protect this with an If statement:
VB.NET:
smPanel.HorizontalScroll.Value = lgPanel.HorizontalScroll.Value
 
Back
Top