Add VScrollbar To Panel

Hello Experts,

I have a Panel for which I have specified a dimension. In runtime, I am adding child panels within this panel. I have also added a vertical scrollbar to this panel.

All I want is to scroll through the contents of the parent panel, such that it displays the generated child panels.

Right now, I am able to render the child panels within the parent panel but can't make it scroll. How to do this

I cant find any panel property which can be used to repaint the visible area of the panel while using the scrollbar so that it can be made to scroll.

Please help me as soon as possible. I am badly stuck.

To earn points, you can also post your answer at:
http://www.experts-exchange.com/Programming/Wireless_Programming/Pocket_PCs_All/Q_22028643.html

Regards,
Suman



Answer this question

Add VScrollbar To Panel

  • R Raghu

    Panel is derived from ScrollableControl. It will display scroll bars automatically if any part of any of its child controls is outside its bounds and AutoScroll property is set to True

  • yonderstar

    Hi Alex,

    This is what I knew too.

    But here is the problem I am facing:
    1. I don't see any AutoScroll option in Property page, so I can't set it. Moreover, I dont find that option from the code page as well.

    2. To avoid problem, I removed the parent Panel and started adding the child panels directly to the form. Here I should mention that, I have a label just above the panels at the top of the form and a statusbar and toolbar at the bottom.
      • When the form is loaded in a vertical/portrait format, although the panels cross the bounds of the form, it doesn't show the scrollbar and the statusbar and toolbar is visible immediately.
      • But as soon as I change the display to horizontal/landscape format, the form redraws itself to display the vertical scrollbar, but the statusbar becomes hidden since it goes at the bottom of the form and have to be scrolled down to see it.
    Can you please help I need the scrollbar to be displayed in both the cases.

    Regards,
    Suman



  • Mateus1223

    That's what I thought. THis has been broken in CF 1. In CF 2 it works much better. Consider upgrading your project.

  • PaulKotlyar

    What version of Compact Framework are you using

  • JCollins

    We are working on a Pocket PC 2003 project using .NET Compact Framework 1.1 in C#. We are using Visual Studio 2005 on Windows 2000 Server.

  • CSharpShooter

    Please help me!!!


  • Peter Mackay

     Alex Feinman wrote:
    That's what I thought. THis has been broken in CF 1. In CF 2 it works much better. Consider upgrading your project.


    I upgraded to CF 2, got AutoScroll property for the form, enabled it and it works now.

    Thanks,
    Suman


  • Add VScrollbar To Panel