試圖找到如何在 Visual Studio 中制作滑入/滑出申請表(程式),或者我什至如何用谷歌搜索它?我的意思是我能找到的只是一個具有可滑動面板的表單,但我想要制作的很像 Windows 通知面板,它從右側的螢屏外部滑出,但在我的情況下,它會從頂部滑動.
有人可以幫忙解答我的問題嗎?
uj5u.com熱心網友回復:
你可以試試這個,看看它是否符合你的需求。
創建一個新專案,然后在 Form1 中放置一個按鈕并雙擊該按鈕并在里面寫入:
FormNotif.LoadForm ("some parameter to pass thru")
創建一個名為 FormNotif 的新 winform,將其調整為更小的尺寸 (205 x 145),并將 StartPosition 設定為手動。將計時器添加到 FormNotif(Timer1,間隔:5)。然后只需將此代碼復制并粘貼到 FormNotif:
Public Class FormNotif
Dim psTimerFunc As String
Dim piCount As Integer
Sub LoadForm(MessageDescription As String)
Me.Top = -Me.Height
Me.Left = Screen.PrimaryScreen.Bounds.Width - Me.Width - 10
Me.TopMost = True
Me.BringToFront()
Me.Show()
psTimerFunc = "DOWN"
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Select Case psTimerFunc
Case "DOWN"
Me.Top = Me.Top 5
If Me.Top >= 50 Then
piCount = 0
psTimerFunc = "WAIT"
End If
Case "WAIT"
piCount = 1
If piCount = 600 Then
psTimerFunc = "UP"
End If
Case "UP"
Me.Top = Me.Top - 5
If Me.Top Me.Height < 0 Then
Timer1.Enabled = False
Me.Close()
End If
End Select
End Sub
End Class
您可以使用 MessageDescription 發送一些您需要在 FormNotif 中顯示的資訊,然后使用標簽或適合您需要的東西。幾秒鐘后,訊息將上升并關閉。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/330014.html
