Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set vertical scroll bar in win form

Tags:

c#

winforms

I am very new to win form. I want to develop a form which has a height of around 992*1403. i tried to give the size of the win form as 992*1403, but its taking only 992*876. i am setting an image of size 992*1403 as the background. i need to put a vertical scroll bar. i put that scroll bar but i dnt know how to write the code when the user scrolls that scroll bar.

Please give me some sample codes or links

like image 688
nimi Avatar asked Feb 09 '10 08:02

nimi


1 Answers

For what you are describing, you just need to set the form's Autoscroll property to true. (It is under the "Layout" section). Right-click on the form and select "Properties"

This will add scroll bars if the form doesn't fit into the current window size. No code is required. The scroll bars will only appear when there is a control outside the current view.


Reading your description again, what you might be looking for is a large panel in your form. Add a Panel to your form and make set the location to 0,0 and the size to 992,1403. Then add your controls to the panel. Don't forget to set the form's Autoscroll as mentioned above.

like image 75
bluecoder Avatar answered Sep 23 '22 16:09

bluecoder