如何在表格之间做出平滑过渡的效果? [英] How to make smoothly transition effect between form?

查看:110
本文介绍了如何在表格之间做出平滑过渡的效果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题还有一个人问过,我的问题也和这个家伙一样



我有一套相似的表格,大小都相同背景颜色,应用程序使用form.open和form.close命令在表单之间切换。

我遇到的问题是转换期间有延迟,而不是从一个表单平滑过渡另一个表格关闭时会显示一个明显的闪光,显示下面的桌面,然后打开下一个表格。我尝试过form.open,form.hide,form.open的各种组合,似乎没有消除形式之间分散注意力的闪烁。有没有办法顺利过渡表格?有点像:首先在新表格上覆盖新表格,然后关闭看不见的旧表格?



谢谢

This question has also asked by one more guy, my question is also same as this guy

I have a set of similar forms, all the same size and background colour, and the application switches between the forms with form.open and form.close commands.
The issue I have is there is a delay during the transition, and instead of a smooth transition from one form to another there is a noticeable flash as one form closes, reveals the desktop underneath, and then the next form opens. I have tried various combinations of form.open, form.hide, form.open, and none seems to eliminate the distracting flashing between forms. Is there a way to smoothly transition forms? Something like: overlay the new form over the old form first, and then close the old form which is out of sight?

Thanks

推荐答案

Public Class Form2

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Top = Form1.Top
        Me.Left = Form1.Left
        timer1.enabled = True
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If Me.Width < Form1.Width - 5 Then
            Me.Width += 5
        Else
            Me.Width = Form1.Width
            Timer1.Enabled = False
        End If
        Me.Focus()
    End Sub
End Class



在表单中添加一个计时器并将时间设置为1000毫秒


Add a timer in your form and set time as 1000ms


这篇关于如何在表格之间做出平滑过渡的效果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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