• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

VB Help

narzy

Elite Member
ok so I want to make an annoying program because I am bored. I want to make a picture box move (scroll) from the top of the form to the bottem then back to the top and down again in an infinate loop. here is what I have on the picture code... just need to know how to get the location to move

Dim varloop As Integer
Dim iloop As Integer
Dim ilooptwo As Integer
PictureBox1.Location(what goes here?)
For ilooptwo = 1 To 3 Step -1
varloop = 1

For iloop = 1 To 24 Step 1
varloop = varloop + 1
Next iloop

Next ilooptwo


give a bro a hand 😉

 
That's one of the properties for it - can't remember the name - click on the box and properties on the side you can see a bunch like height, width and the vertical position and the vertical position is the one to manipulate.
 
But the properties box will tell you what the property is called like verticalposition and then:

picturebox1.verticalposition = 500

to set it in code.
 
Don't forget to refresh the box, or else you won't see any changes until the end of the procedure.

I made that mistake when I was programming a simple slot machine. Took me a while to figure out why the slot face goes directly to the final fruit instead of 'spinning'.
 
Originally posted by: Shelly21
Don't forget to refresh the box, or else you won't see any changes until the end of the procedure.

I made that mistake when I was programming a simple slot machine. Took me a while to figure out why the slot face goes directly to the final fruit instead of 'spinning'.
how?

 
Isn't it picturebox1.left to control the horizontal position and picturebox1.top to control the vertical position?
 
Originally posted by: narzy
Originally posted by: Shelly21
Don't forget to refresh the box, or else you won't see any changes until the end of the procedure.

I made that mistake when I was programming a simple slot machine. Took me a while to figure out why the slot face goes directly to the final fruit instead of 'spinning'.
how?

Something like picturebox.refresh

What version VB are you doing?
 
Ok, to refresh the display it'd be

object.refresh()

Where object is the name of the object that contains PictureBox1.

From looking at your code, you have to do it after every change in the position to be able to see it move.
 
Originally posted by: gooneygoon
Shelly21,

Stop posting here. You're the one that makes me horny. I have some neffing to concentrate on.

Eh? I can describe what I'm doing right now, maybe that'll help.



 
Back
Top