Scrolling panel

  • Thread starter Thread starter Nathan
  • Start date Start date
N

Nathan

I need a panel with only a vertical or only a horizontal scroll bar. Is
there a way to do that?

Nathan
 
There's no automatic solution to this. If you set AutoScroll to true, then
the scrollbars will appear based on the contents of panel (too wide to
display, you get a horizontal bar, too short to display, you get a vertical
bar).

Your best bet is probably to add a scrollbar control yourself, and then
track events on it. When the user scrolls the scrollbar, you have code to
scroll/shift the panel's view.
 
Nathan said:
I need a panel with only a vertical or only a horizontal scroll bar. Is
there a way to do that?

The code below will remove the vertical scrollbar. Notice that I didn't
check for side-effects:

\\\
Me.Panel1.Region = _
New Region( _
New Rectangle( _
0, _
0, _
Me.Panel1.Width - SystemInformation.VerticalScrollBarWidth, _
Me.Panel1.Height _
) _
)
///
 
Just add the panel control then add a scrollbar control to the panel...you
can set the dock property to the type of scroll bar, i.e., right, left,
bottom, or top.
 
Dennis said:
Just add the panel control then add a scrollbar control to the panel...you
can set the dock property to the type of scroll bar, i.e., right, left,
bottom, or top.

In addition to that, you will have to implement scrolling the panel's
contents yourself.
 

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

Back
Top