Blendet eine Form langsam rechts unten über der Taskleite ein.
Wird benötigt
Verbesserungsvorschläge erwünscht
Wird benötigt
- 1x Windows Form (Name: Popup)
VB.NET-Quellcode
- Public Class Popup
- Private y As Integer
- Private t As Threading.Thread
- Delegate Sub SetLocationCallback(ByVal location As Point)
- Delegate Sub CloseCallback()
- Private Sub SetLocation(ByVal location As Point)
- If Me.InvokeRequired Then
- Dim d As New SetLocationCallback(AddressOf SetLocation)
- Me.Invoke(d, New Object() {[location]})
- Else
- Me.Location = location
- End If
- End Sub
- Private Sub _Close()
- If Me.InvokeRequired Then
- Dim d As New CloseCallback(AddressOf _Close)
- Me.Invoke(d)
- Else
- Me.Close()
- End If
- End Sub
- Private Sub Popup_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- Me.y = My.Computer.Screen.WorkingArea.Height + Me.Height
- Me.TopMost = True
- Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
- Me.Location = New Point(My.Computer.Screen.WorkingArea.Width - Me.Width, y)
- Me.t = New Threading.Thread(AddressOf _show)
- Me.t.Start()
- End Sub
- Private Sub Popup_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
- Me.t = New Threading.Thread(AddressOf _hide)
- Me.t.Start()
- End Sub
- Private Sub _show()
- While Me.Location.Y >= My.Computer.Screen.WorkingArea.Height - Me.Height + 50
- Me.SetLocation(New Point(My.Computer.Screen.WorkingArea.Width - Me.Width, y))
- Me.y -= 50
- Threading.Thread.Sleep(50)
- End While
- End Sub
- Private Sub _hide()
- While Me.Location.Y <= My.Computer.Screen.WorkingArea.Height + Me.Height - 50
- Me.SetLocation(New Point(My.Computer.Screen.WorkingArea.Width - Me.Width, y))
- Me.y += 50
- Threading.Thread.Sleep(50)
- End While
- Me._Close()
- End Sub
- End Class
Verbesserungsvorschläge erwünscht