Visual Basic Nerds - Plz Help Me!!!

Mojo

Likes Dirt
i have a text box that has to read 0.1, then under that txt box is a scroll bar, i have to make the scroll bar increase the value in the text box by 1E-1 thus making the number go from 0.1 to 0.001 to 0.0001 etc, can anybody help me with the programming?
 

Binaural

Eats Squid
Far from a VB nerd but I delivered project some time ago that made quite a bit of use of that poxy language so let's see if I can help :)

"i have a text box that has to read 0.1, then under that txt box is a scroll bar, i have to make the scroll bar increase the value in the text box by 1E-1 thus making the number go from 0.1 to 0.001 to 0.0001 etc, can anybody help me with the programming?"

1. If you can't make a more complicated control like a scroll bar do what you want, I suggest using a few pushbuttons and a text object and progressively change it as required. Many problems people have with manipulating VB objects are because they are using the wrong object for the job, i.e. a combobox when they should be using a listbox. If things don't seem to add up then try using a different object.

2. Make sure you update the correct attribute. In particular, if you want to show some text in a text box, don't do textobject.name = "blah" (which changes nothing you're interesting in at this level), make sure it's textobject.caption = "name", which changes what is displayed.

3. Make sure you give the object an initial value when the form starts up - lack of good initial values can be a troublemaker.

4. Make sure you don't have a type confusion - adding a number to a string and so on. The caption stored in a text object may have to be cast (type converted) into a floating point number before you can add another floating point number to it. Type conversion in general is one of those not-hard-but-easy-to-forget problems that make my balls ache.

5. Post what you've done already for us to look at. Sometimes, these things are obvious when you can look at the problem and not the description ;)
 
Last edited:
Top