Scroll Bar in panel using windows application!!!!!!!!!!

Posted by Vish2012 under Visual Studio on 7/2/2012 | Points: 10 | Views : 14775 | Status : [Member] | Replies : 2
Hi,

I have taken one spilt container. In that there is two panel. In the second panel i have inserted the form.
Now the problem is when i scroll the form, the scroll doesnot goes fully down so the problem happens that the content which is at the bottom is not able to see...

So is there any solution which i can scroll the form properly....

Pls Help!!!!!!!!!!!!!!!!

Thanks in advance..........................




Responses

Posted by: Gaur1982 on: 7/2/2012 [Member] Starter | Points: 25

Up
0
Down
Just set the AutoScroll property of your Panel to true and it will handle adding the scrollbars for you.

this.panel1.AutoScroll = true;



Gaurav Agrawal
http://www.planetofcoders.com/

Vish2012, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gaur1982 on: 7/2/2012 [Member] Starter | Points: 25

Up
0
Down
If you want to add vertical scroll bar to panel then use this :
Assuming you're using winforms, default panel components does not offer you a way to disable the horizontal scrolling components. A workaround of this is to disable the auto scrolling and add a scrollbar yourself:
ScrollBar vScrollBar1 = new VScrollBar();

vScrollBar1.Dock = DockStyle.Right;
vScrollBar1.Scroll += (sender, e) => { panel1.VerticalScroll.Value = vScrollBar1.Value; };
panel1.Controls.Add(vScrollBar1);

Detailed discussion here: http://social.msdn.microsoft.com/Forums/en-IE/winforms/thread/6b9c2c72-e91a-40f0-a835-c12328490c0c


Gaurav Agrawal
http://www.planetofcoders.com/

Vish2012, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response