|
-
Jan 20th, 2007, 07:20 AM
#1
Thread Starter
Hyperactive Member
[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! 
-
Jan 20th, 2007, 07:24 AM
#2
PowerPoster
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.
-
Jan 20th, 2007, 07:27 AM
#3
Thread Starter
Hyperactive Member
Re: help
VB Code:
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 20
End Sub
Private Sub Timer1_Timer()
Do Until Me.Width < 600 And Me.Height < 400
Me.Width = Me.Width + 30
Me.Height = Me.Height + 20
Loop
End Sub
i cant remmember exactly what i used before this.
If a post has been usefull then Rate it! 
-
Jan 20th, 2007, 07:32 AM
#4
PowerPoster
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:
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 20
End Sub
Private Sub Timer1_Timer()
Me.Width = Me.Width + 30
Me.Height = Me.Height + 20
if Me.Width => 600 or Me.Height => 400 then
Timer1.Enabled = False
Me.Width = 600
Me.Height = 400
End If
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.
-
Jan 20th, 2007, 07:37 AM
#5
Thread Starter
Hyperactive Member
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! 
-
Jan 20th, 2007, 07:48 AM
#6
PowerPoster
Re: help
This code works for me...using the TWIPs rather than pixels setting (15x the value for each pixel, usually)
VB Code:
Private Sub Form_Load()
Me.Width = 1
Me.Height = 1
Timer1.Enabled = True
Timer1.Interval = 10
End Sub
Private Sub Timer1_Timer()
Me.Width = Me.Width + 30
Me.Height = Me.Height + 20
If Me.Width >= 9000 Or Me.Height >= 6000 Then
Timer1.Enabled = False
Me.Width = 9000
Me.Height = 6000
End If
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.
-
Jan 20th, 2007, 07:52 AM
#7
PowerPoster
Re: help
If you want it to be a bit smoother and smarter, try this code:
VB Code:
Private Sub Form_Load()
Me.Width = 1
Me.Height = 1
wid = (9000 - Me.Width) / 100
hei = (6000 - Me.Height) / 100
Timer1.Enabled = True
Timer1.Interval = 10
End Sub
Private Sub Timer1_Timer()
Me.Width = Me.Width + wid
Me.Height = Me.Height + hei
If Me.Width >= 9000 Or Me.Height >= 6000 Then
Timer1.Enabled = False
Me.Width = 9000
Me.Height = 6000
End If
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.
-
Jan 20th, 2007, 07:57 AM
#8
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|