Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking Flat ScrollBar Active X to the Container Class in FoxPro

Status
Not open for further replies.

ugagrad

Programmer
Sep 12, 2003
49
US
Hey Guys,
I have FoxPro version 8.0 and I am trying to link a scroll bar to a container on the form. I have tried the Scrollbar 2.0 and the Flat Scrollbar and I can not seem to get it to work. Does anyone out there know how to accomplish this task.

Thanks in advance,
 

What do you mean by " I am trying to link a scroll bar to a container on the form"?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
If using the flat scrollbar then you can set the min property to 0 and the max property based on your container's dimensions (height or width). Then it is just a matter of writing code in the scrollbar's change and scroll methods to move your container around on the form.

For instance, lets say that the container you have up on your form is 1000 X 1000 pixels and you have two scrollbars on the form, one on the bottom of the form and the other on the right-hand side of the form. Each of these scrollbar's would have a max of 1000 (or 1000 - form dimension if you want to keep the container from scrolling all the way off the form).

Then in your vertical scrollbar's change and scroll events you'd have code like:

thisform.container1.top = this.value * -1

...for the horizontal scrollbar it would be:

thisform.container1.left = this.value * -1

The container can now be moved around using the scrollbars.

boyd.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top