|
-
Aug 28th, 2007, 05:58 PM
#1
Thread Starter
Junior Member
[RESOLVED] How to Animate resizing of the main form?
Is there a way to ANIMATE the re-sizing of the main form?
I attempted to the below, but it's a failure.
Code:
Private Sub dropDownToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
Dim x As Integer = 454
Dim y As Integer = 355
If state Then
While y <= 589
ClientSize = New System.Drawing.Size(x, y = y + 1)
Me.Refresh()
End While
ToolStripButton1.Image.RotateFlip(RotateFlipType.Rotate180FlipNone)
state = False
Else
While y >= 355
ClientSize = New System.Drawing.Size(x, y = y - 1)
Me.Refresh()
End While
ToolStripButton1.Image.RotateFlip(RotateFlipType.Rotate180FlipNone)
state = True
End If
End Sub
Any ideas is appreciated!
Thanks,
Newbiekid
-
Aug 28th, 2007, 06:22 PM
#2
Re: How to Animate resizing of the main form?
I'm not sure what the effect you are going for is, but typically if I am going to animate something manually, I'll use a timer and each time it fires, change the value(s) that control the animation. In your case, it looks like you would want to increment the y value in the timer, set the client size then call the form's refresh method.
kevin
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
-
Aug 28th, 2007, 10:39 PM
#3
Thread Starter
Junior Member
Re: How to Animate resizing of the main form?
 Originally Posted by kebo
I'm not sure what the effect you are going for is, but typically if I am going to animate something manually, I'll use a timer and each time it fires, change the value(s) that control the animation. In your case, it looks like you would want to increment the y value in the timer, set the client size then call the form's refresh method.
kevin
Cool!, do you have an example or a link on How to create timer for animation?
-
Aug 28th, 2007, 10:50 PM
#4
Re: How to Animate resizing of the main form?
try this...
vb Code:
Public Class Form1
Dim Timer1 As New Timer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
AddHandler Timer1.Tick, AddressOf Timer1_Tick
Me.Timer1.Interval = 20
Me.Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
Const MAX As Integer = 400
Const Min As Integer = 200
Static GettingBigger As Boolean = True
Static mySize As Integer = Min
If GettingBigger Then
mySize += 1
If mySize >= MAX Then GettingBigger = False
Else
mySize -= 1
If mySize <= Min Then GettingBigger = True
End If
Me.Size = New Size(mySize, mySize)
Me.Refresh()
End Sub
End Class
kevin
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
-
Aug 29th, 2007, 06:59 PM
#5
Thread Starter
Junior Member
Re: How to Animate resizing of the main form?
You are DA BOMB..!!!
That worked pretty well.
-
Aug 29th, 2007, 07:13 PM
#6
Re: [RESOLVED] How to Animate resizing of the main form?
cool...now rewrite it to fit your app and show me that you learned how to do it
kevin
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
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
|