Scrollable Control Scroll Bars

  • Thread starter Thread starter Paul Cheetham
  • Start date Start date
P

Paul Cheetham

Hi,

I have created a control derived from a Scrollable control.

Can anyone tell me how I can get a reference to the scroll bars, so that
I can manipulate the positions in code?

If I enumerate the child controls they don't show, but there bust be a
way of accessing them.

This is causing me a major headache, and is now holding up my project.


Thankyou.


Paul Cheetham
 
Do you need a horizontal or vertical scrollbar? As it's probably best
to derive from HScrollBar and VScrollBar, depending on what you need.

Else take a look on MSDN for SetScrollPos() (user32.dll),SB_CTL as
there is a lot more available in the control than .NET gives you.
 
It's a vertical scroll bar.

The Scrollable control generates these itself, and I can change the
position etc. if I can get a reference to it, but there doesn't appear
to be any way of getting a reference to the actual scroll bar control.

(I'm using VS2003 and .Net 1.1)


Thanks.

Paul
 
Chris,

Thanks for your help.

The GetScrollInfo and SetScrollInfo functions worked great.
You don't need to reference the scroll bars directly using these, you
just need the window handle of the control.


Thanks again.

Paul
 
Back
Top