我使用一个我调用的弹出窗体来模拟一些程序是如何从Windows的startbar弹出的。通过按摩,你可以让它做你想做的事。创建一个带有计时器控件和标签的表单,并将代码复制到表单中。使用formPopUp调用表单。展示(或任何你称之为表格的东西)。
- Dim DirectionIsUp As Boolean ' Up is True, Down is False
- Private Sub Form_Load()
- 'Move it below the visible screen (and a little just in case)
- Me.Top = Screen.Height + 10
- 'Move it to the far right of the visible screen (minus a little, just for esthetics)
- Me.Left = Screen.Width - (Me.Width + 100)
- 'We're gonna move it up
- DirectionIsUp = True
- Me.Label1.Caption = "FINISHED"
- End Sub
- Private Sub Timer1_Timer()
-
- 'Move at 10 millisecond intervals (100 times a second, 3 times what the eye can see)
- Timer1.Interval = 10
-
- ' If it's moving up
- If DirectionIsUp Then
-
- 'Move it up 50 twips every 10 milliseconds
- Me.Top = Me.Top - 50
-
- 'Move until the whole form is shown (minus 10 twips to make sure it still touches the bottom of the screen)
- If (Me.Top <= Screen.Height - (Me.Height - 10)) Then
-
- ' This specifies how long it will stay shown (Unmoving)
- Timer1.Interval = 3000
-
- ' We're gonna move it down next...
- DirectionIsUp = False
- End If
-
- Else
- 'Move it down 50 twips every 10 milliseconds
- Me.Top = Me.Top + 50
-
- 'Move until the whole form is shown (plus 10 twips to make sure it's hidden)
- If Me.Top >= Screen.Height + 10 Then
- Timer1.Enabled = False
- Unload Me
- End If
- End If
- End Sub
|