Click here to Skip to main content
12,943,528 members (45,741 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
how to apply minimize animation in windows form in vb.net just like in windows 7

plss help!!
Posted 4-Mar-13 23:38pm
Omkaara1.4K
Comments
Jeff Blankenburg 5-Mar-13 8:01am
   
I'm going to need some help here. Can you specifically describe which animation you mean? What are you trying to apply this animation to? Do you have some code you could provide?
Omkaara 6-Mar-13 3:04am
   
not exactly animation
just like windows 7 minimize effects when i minimized a window in win 7 os it minimizes bit slowly
no; not tried coding yet
i just want idea that what Microsoft did for that minimize effect
so i can do for my vb2005 application
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

You can use a timer and the control's .left/.right/.top/.bottom to animate the control's position.

'Minimize Control
    Private Sub TMR_Min_Tick(sender As Object, e As EventArgs) Handles TMR_Min.Tick
        Dim RSV As Integer
        RSV = "-" & PAN_PBAR.Size.Height
        If PAN_PBAR.Top > 1080 Then '1080 is the height of the control/form
            TMR_Min.Enabled = False
            PAN_PBAR.Location = New Point(0, 1080)
        Else
            PAN_PBAR.Top += 50 'this is how many pixels the control is moved per tick(adjust this and the timer interval to get the desired speed that you want)
        End If
    End Sub


'Activate
Private Sub BTN_Min_Click(sender As Object, e As EventArgs) Handles BTN_Min.Click
TMR_Min.Enabled = True
End Sub
  Permalink  
v2
Comments
Omkaara 18-Mar-13 9:14am
   
but after minimizing i cant magzimise it ....
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

To reverse it(maximize), just reverse the direction -

Private Sub TMR_Max_Tick(sender As Object, e As EventArgs) Handles TMR_Max.Tick
Dim RSV As Integer
RSV = "-" & PAN_PBAR.Size.Height
If PAN_PBAR.Top = 0 Then '1080 is the height of the control/form
TMR_Max.Enabled = False
PAN_PBAR.Location = New Point(0, 0)
Else
PAN_PBAR.Top -= 50 'this is how many pixels the control is moved per tick(adjust this and the timer interval to get the desired speed that you want)
End If
End Sub

If you have any more problems, I'll be glad to help.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 4,643
CHill60 2,930
Maciej Los 2,328
Jochen Arndt 1,900
ppolymorphe 1,765


Advertise | Privacy | Mobile
Web02 | 2.8.170518.1 | Last Updated 18 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100