Code:
#Region "AlertBox"
Enum Style
Success = 1
Critical = 2
Information = 3
End Enum
Sub Alert(ByVal Style As Style, ByVal Text As String)
Dim AlertBox As New FlatAlertBox With {.Dock = DockStyle.Bottom}
Me.Controls.Add(AlertBox)
AddHandler AlertBox.Click, AddressOf CloseAlert
Dim CurrentHeight As Integer = Me.Size.Height
Do Until Me.Size.Height >= CurrentHeight + 42
Me.Size = New Drawing.Size(Me.Size.Width, Me.Size.Height + 2)
Loop
Select Case Style
Case 1
AlertBox.kind = FlatAlertBox._Kind.Success
Case 2
AlertBox.kind = FlatAlertBox._Kind.Error
Case 3
AlertBox.kind = FlatAlertBox._Kind.Info
End Select
AlertBox.Text = Text
AlertBox.Visible = True
End Sub
Sub CloseAlert()
Dim CurrentHeight As Integer = Me.Size.Height
Do Until Me.Size.Height <= CurrentHeight - 42
Me.Size = New Drawing.Size(Me.Size.Width, Me.Size.Height - 2)
Loop
End Sub
#End Region
Usage: Alert(Style.Information, "It works!")
Style.Alert
Style.Info
Style.Success
For your alertbox, if you want somewhat an easier way to use the alertbox
(You don't need to put an alertbox into the form, as it'll automatically generate one and add it at the bottom of the app, also increases the size to put it in)