Results 1 to 8 of 8

Thread: [RESOLVED] help

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2006
    Posts
    419

    Resolved [RESOLVED] help

    im trying to make a swipe effect and i am having a few problems making this work...

    im wanting it so that when i load it will load up from a 1x1 form and become 600 x 400 pixel form.

    i have tried using a timer for this and i just can seem to get it fully right, any help would be great, maybe different ways of doing it/code/tutorials etc...

    thanks
    lee
    If a post has been usefull then Rate it!

  2. #2
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Re: help

    I don't see why a timer wouldn't work...what have you tried exactly?
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2006
    Posts
    419

    Re: help

    VB Code:
    1. Private Sub Form_Load()
    2. Timer1.Enabled = True
    3. Timer1.Interval = 20
    4. End Sub
    5.  
    6. Private Sub Timer1_Timer()
    7.  
    8. Do Until Me.Width < 600 And Me.Height < 400
    9. Me.Width = Me.Width + 30
    10. Me.Height = Me.Height + 20
    11. Loop
    12.  
    13. End Sub
    i cant remmember exactly what i used before this.
    If a post has been usefull then Rate it!

  4. #4
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Re: help

    Your problem is you are using the do/loop in the code...if you want the timer to control how fast the form resizes you don't want the loop in that section...this should work better :-)

    VB Code:
    1. Private Sub Form_Load()
    2. Timer1.Enabled = True
    3. Timer1.Interval = 20
    4. End Sub
    5.  
    6. Private Sub Timer1_Timer()
    7.  
    8. Me.Width = Me.Width + 30
    9. Me.Height = Me.Height + 20
    10. if Me.Width => 600 or Me.Height => 400 then
    11. Timer1.Enabled = False
    12. Me.Width = 600
    13. Me.Height = 400
    14. End If
    15. End Sub
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2006
    Posts
    419

    Re: help

    this doesnt work right, like the last code it makes the form 30 x 20 and it just stops?
    If a post has been usefull then Rate it!

  6. #6
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Re: help

    This code works for me...using the TWIPs rather than pixels setting (15x the value for each pixel, usually)

    VB Code:
    1. Private Sub Form_Load()
    2. Me.Width = 1
    3. Me.Height = 1
    4. Timer1.Enabled = True
    5. Timer1.Interval = 10
    6. End Sub
    7.  
    8. Private Sub Timer1_Timer()
    9.  
    10. Me.Width = Me.Width + 30
    11. Me.Height = Me.Height + 20
    12. If Me.Width >= 9000 Or Me.Height >= 6000 Then
    13. Timer1.Enabled = False
    14. Me.Width = 9000
    15. Me.Height = 6000
    16. End If
    17. End Sub
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

  7. #7
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Re: help

    If you want it to be a bit smoother and smarter, try this code:

    VB Code:
    1. Private Sub Form_Load()
    2. Me.Width = 1
    3. Me.Height = 1
    4. wid = (9000 - Me.Width) / 100
    5. hei = (6000 - Me.Height) / 100
    6. Timer1.Enabled = True
    7. Timer1.Interval = 10
    8. End Sub
    9.  
    10. Private Sub Timer1_Timer()
    11.  
    12. Me.Width = Me.Width + wid
    13. Me.Height = Me.Height + hei
    14. If Me.Width >= 9000 Or Me.Height >= 6000 Then
    15. Timer1.Enabled = False
    16. Me.Width = 9000
    17. Me.Height = 6000
    18. End If
    19. End Sub

    The "/100" in the form load is the number of "frames" it will take to fully expand out...so with the settings I have in there, it'll take 1 second to display 100 frames of resize :-)

    You need to also have a module with "Public wid, hei" in it
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2006
    Posts
    419

    Re: help

    thanks that works great


    EDITED
    If a post has been usefull then Rate it!

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