Results 1 to 3 of 3

Thread: smallest step to move a shape?

  1. #1

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    Hi,
    I'm still working on shapes, now I found the following strange behaviour:
    You have shape on your form (scalemode Pixel)
    Using the Timer you move it by 0.1 for .left and .top (shape1.move shape1.left+0.1,shape1.top+0,1), everything works o.k.
    Try to do the same with a value of 0.01. Nothing happening, that's the strange thing, does anyone know why!
    I even looked at the values of shape1.left and.top.
    In the first case everything worked as planned (the values increased, but not excatly by 0,1 steps???). In the second case the values just stayed the same.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  2. #2
    Guest
    That's probably because it's such a small number that VB will just round it down to 0.

  3. #3
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    Store it in your own variable:

    Code:
    Dim PosX as Single
    Dim PosY as Single
    
    Timer()
       PosX = PosX + 0.01
       PosX = PosX - 0.1
    
       Shape1.Move PosX, PosY
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width