如何在vb.net中应用像Windows 7这样的最小化动画 [英] how to apply minimize animation like windows 7 in vb.net

查看:92
本文介绍了如何在vb.net中应用像Windows 7这样的最小化动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Windows 7窗体中应用最小化动画,就像在Windows 7中一样



plss help !!

how to apply minimize animation in windows form in vb.net just like in windows 7

plss help!!

推荐答案

您可以使用计时器和控件'.ftft / .right / .top / .bottom来设置控件的位置。



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





''激活

私人Sub BTN_Min_Click(发件人为Obje ct,e As EventArgs)处理BTN_Min.Click

TMR_Min.Enabled = True

End Sub



''Activate
Private Sub BTN_Min_Click(sender As Object, e As EventArgs) Handles BTN_Min.Click
TMR_Min.Enabled = True
End Sub


反转它(最大化) ,只需反转方向 -



Private Sub TMR_Max_Tick(发送者为对象,e为EventArgs)处理TMR_Max.Tick

Dim RSV As Integer

RSV = - &PAN_PBAR.Size.Height

如果PAN_PBAR.Top = 0那么''1080是控件/表格的高度

TMR_Max.Enabled = False

PAN_PBAR.Location =新点(0,0)

否则

PAN_PBAR.Top - = 50 ''这是每个刻度移动控件的像素数(调整此值和定时器间隔以获得所需的速度)

结束如果

结束Sub



如果您还有其他问题,我很乐意提供帮助。
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.


这篇关于如何在vb.net中应用像Windows 7这样的最小化动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆