Hello,
Here's a basic exercise with sample code:
1. Add a Hscrollbar to a panel in your windows-forms project.
2. In the properties window (get it open from "View" if you don't have it open), change the "dock" property to "Bottom". This step is not essential.
2. Add a button to your panel on the left side of it.
3. Click the button with your mouse, then use the left arrow key on your keyboard to move it slightly over the left edge of the panel, so that half of the button is visible and half isn't.
4. Now for the sample code! Double click the horizontal scroll bar. you should see this:
private void hScrollBar1_Scroll(object sender, ScrollEventArgs e)
{
}
Now change that to this:
private void hScrollBar1_Scroll(object sender, ScrollEventArgs e)
{
foreach (Control c in panel1.Controls)
{
c.Left += e.NewValue - e.OldValue;
}
}
Code explanation: For each control in the panel you made, the computer changes the left margin of the control by the change in the scroll bar.
Hit F5 on your keyboard and play with the result!
I recommend you play with this code a bit to perfect it. I admit I haven't perfected its behaviour ;-). If you find this helpful, I'd be happy to know :-)