Scrooling A Panel

S

shahoo

Hi,
I am trying to add some controls (say buttons) to a panel. At some
stage the controls are
too much to be show on the panel, so I set the Autoscroll property of
the panel to true.
But my problem is that I don't want the user to use the scroll bars of
the panel, I want to
add two custom buttons to scroll the panel. When I set the Visible
property of
HorizontalScroll and VerticalScroll of the panel to false, It still
shows them.
Can anyone please help me with that?
Thanks in advance.
 
A

Alberto Poblacion

shahoo said:
I am trying to add some controls (say buttons) to a panel. At some
stage the controls are
too much to be show on the panel, so I set the Autoscroll property of
the panel to true.
But my problem is that I don't want the user to use the scroll bars of
the panel, I want to
add two custom buttons to scroll the panel. When I set the Visible
property of
HorizontalScroll and VerticalScroll of the panel to false, It still
shows them.
Can anyone please help me with that?

If you don't want the user to use scrollbars, but rather your own
buttons, you can do the following:
- Don't set Autoscroll.
- Place your "scrolling" panel inside another panel. Make the internal
panel big enough to contain your controls. Make the outer panel the size
that you want to be visible at any time.
- In the click event of your two buttons, increment or decrement the
"Top" property of the internal panel.

Note that this will not give the user any feedback on how much "up" or
"down" in the panel he is currently positioned. If you need this, you will
have to add some visual indicator and manually adjust it based on the
previously mentioned "Top" property.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top