• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 139
  • Last Modified:

How can i use scrollBars to see a complet from?

i was drawing a big circle in the midel of a form,so i could not see the holl circle. How  can i use vertical & horizontal scroll Bars?
thanks for help
1 Solution
OK first of all the scroll bars don't actually do anything by themselves, all they are is something which appears to the screen and they can be clicked on and their value changes accordingly.

OK So what you have to do is inside the Scroll bar_Click function you put your code. For your problem say the Vertical Scroll bar Code would be

CircleObject.top = (VScrollBar.Value * -1) * Multiplier

This is a pretty simple example but should show you how it works. CircleObject is as you can guess the Circle you drew. VScrollBar is the Scroll Bar Control.

I'm multiplying it by -1 so it's value is negated because you you scroll down the scroll bar value is increased and you want the CircleObjects Top Value to be decreased ie Down past 0

The Multiplier is just a constant/variable which you can change to whatever you like to. Obviously the higher it is set the more the Circle will move when it is clicked.

You don't have to use this but I've found it easier than stuffing around with the Min and Max values, it just makes things a little quicker and simpler to set up and get it working nicely.
You have to use a RichTextBox, PictureBox, or Frame or other control on the form to get the scrollbars to work on a form. There's an example in the VB examples, but I forget which one it is.
nilehawkAuthor Commented:
thank you (wolfiii)
thank you (hddp666)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now