Click here to Skip to main content
15,922,894 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi Im using Visual Studio, making a windows application and want to make it so at the side it has a scroll bar that scroll down the entire form. I have added the Vertical Scroll bar but dont know how to attach it to the form properly. Please help.

Code so far:

C#
public frmNav()
{
    InitializeComponent();
}
private void btnOneToNine_Click(object sender, EventArgs e)
{
    Process.Start("frmOneToNine");
}
private void vScrollBar1_Scroll(object sender, ScrollEventArgs e)
{
}


As you can see there is a button and basically I want many many buttons and labels on the form but need more room, so a scroll bar is a nessisary.
Posted

You may not need to add a ScrollBar. The Form has an AutoScroll property that handles most scenarios pretty well.
 
Share this answer
 
Comments
WurmInfinity 27-Oct-10 11:17am    
Hmmmm im gunna play with something and come back to you on that one
WurmInfinity 27-Oct-10 11:18am    
Im actually retarded. Well I am a beginner so its all sorta falling into place, but yeah the autoscroll works wonders :D thanks
I hope this will help you

Vertical ScrollBar in C#
[^]
 
Share this answer
 
Comments
WurmInfinity 27-Oct-10 10:41am    
Already been trying to use that, cant make heads or tales of the bit where it says
First step to create a dynamic VScrollBar is to create an instance of VScrollBar class. The following code snippet creates a VScrollBar control object.

VScrollBar vScroller = new VScrollBar();

dunno were to place it

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