Sign in to follow this  

Visual basic 6 scroll bars

This topic is 4665 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a text box with an ability score inside. I have placed a tiny scroll bar to its immediate right. The score inside is an integer variable. I want the scroll bar to add one to the variable displayed in the text box if clicked upward and to subtract one to the value if clicked downward. I for the life of me cannot get this to work. I would greatly appreciate any help. Please use laymen’s terms. Thank you.

Share this post


Link to post
Share on other sites
Yeah, or even two seperate buttons if you like. One for plus and one for minus.

Scroll bars require you to have a maximum and a minimum value - the default is 0-10 I think. If that's what your looking for then great but by the sounds of it it isn't.

If your using command buttons you'd do

Addition command button (cmdAdd perhaps)
Text1.text = val(Text1.text) + 1

Subtraction command button (cmdSubtract)
Text1.text = val(Text1.text) - 1

For a scroll bar, remember to set the min and max vals first then simply do in the
scroll bar change event :
Text1.text = vscrollbar1.value

Matt

Share this post


Link to post
Share on other sites
You can also update the scroll bar value from the text value if you want to keep them in sync.
in the text change method, you can put vscroll1.value = val(text1.text)

Share this post


Link to post
Share on other sites

This topic is 4665 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this