Test Toast

Imports System.Windows.Forms

Imports Windows.UI.Notifications

Module Module1

    Sub Main()

        'Open regedit.exe

        'Navigate to HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced

        'Set (Or add) EnableBalloonTips (as REG_DWORD) And set value to 1

        'Reboot.

        Dim toast As New NotifyIcon

        toast.Icon = My.Resources.banana

       toast.BalloonTipText = "Drive Available"

        toast.BalloonTipTitle = "R: Mapped Successfully"

        toast.Visible = True

        toast.ShowBalloonTip(5000)

        'Dim dDateStart As DateTime = Now

        'While DateDiff(DateInterval.Second, dDateStart, Now) < 5

        '    Console.WriteLine(DateDiff(DateInterval.Second, dDateStart, Now))

        '    Application.DoEvents()

        'End While

        'Threading.Thread.Sleep(5000)

    End Sub

End Module

A Nicer Toast when Balloons dont't work

Imports System.Runtime.InteropServices
Public Class Toast
    <DllImport("user32.dll", EntryPoint:="AnimateWindow")>
    Private Shared Function AnimateWindow(ByVal hWnd As IntPtr, ByVal dwTime As UInteger, ByVal dwFlags As UInteger) As <MarshalAs(UnmanagedType.Bool)> Boolean
    End Functionemo
    Private Const AW_HIDE As Integer = &H10000    Private Const AW_BLEND As Integer = &H80000
    Private Const AW_VER_POSITIVE As Integer = &H4
    Private Const AW_VER_NEGATIVE As Integer = &H8
    Private Const AW_SLIDE As Integer = &H40000
    'https://www.dreamincode.net/forums/topic/383202-windows-toast-popup/
    Public Sub New(ByVal MsgTitle As String, ByVal MsgText As String)
        InitializeComponent()
        Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
        Me.Size = New Size(300100)
        Me.ShowInTaskbar = False
        Me.BackColor = Color.SkyBlue
        Me.StartPosition = FormStartPosition.Manual
        'Me.Location = New Point(Screen.PrimaryScreen.Bounds.Width - Me.Width, 0)
        Dim x As Integer = Screen.PrimaryScreen.WorkingArea.Width
        Dim y As Integer = Screen.PrimaryScreen.WorkingArea.Height - Me.Height
        Do Until x = Screen.PrimaryScreen.WorkingArea.Width - Me.Width
            x = x - 1
            Me.Location = New Point(x, y)
        Loop
        Me.TopMost = True
        Label1.Location = New Point(1210)
        Label1.ForeColor = Color.White
        Label1.Font = New Font("Lucida Sans"12, FontStyle.Bold Or FontStyle.Underline)
        Label1.Text = MsgTitle
        Label2.Location = New Point(1245)
        Label2.ForeColor = Color.White
        Label2.Font = New Font("Lucida Sans"10, FontStyle.Bold)
        Label2.Text = MsgText
        'Button1.FlatStyle = FlatStyle.Flat
        'Button1.FlatAppearance.BorderSize = 0
        'Button1.FlatAppearance.MouseOverBackColor = Color.SkyBlue
        'Button1.BackColor = Color.SkyBlue
        'Button1.ForeColor = Color.White
        'Button1.Text = "X"
        'Button1.Font = New Font("Microsoft Sans Serif", 10, FontStyle.Bold)
        'Button1.Size = New Size(25, 25)
        'Button1.Location = New Point(Me.Width - Button1.Width, 0)
    End Sub
    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) 'Handles Button1.Click
        Me.Close()
    End Sub
    Private Sub Form2_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        AnimateWindow(Me.Handle, 1000, AW_HIDE Or AW_SLIDE Or AW_VER_POSITIVE)
    End Sub
    Private Sub Form2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        AnimateWindow(Me.Handle, 1000, AW_SLIDE Or AW_VER_NEGATIVE)
    End Sub
    'Private Sub Form2_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
    '    AnimateWindow(Me.Handle, 1000, AW_HIDE Or AW_SLIDE Or AW_VER_NEGATIVE)
    'End Sub
    'Private Sub Form2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    '    AnimateWindow(Me.Handle, 1000, AW_SLIDE Or AW_VER_POSITIVE)
    'End Sub
End Class

x x 
x

Tooltip on a label (control)

    Sub SetToolTipForNoPings(sText As String, Optional bClear As Boolean = False)

        Dim tt As ToolTip = New ToolTip

        Dim sOut As String = tt.GetToolTip(Label12)

        If bClear Then sOut = ""

        sOut = sOut & "," & sText

        tt.SetToolTip(Label12, sOut)

    End Sub

Turn off Tabs in TabControl

        TabControl1.Appearance = TabAppearance.FlatButtons

        TabControl1.ItemSize = New Size(0, 1)

        TabControl1.SizeMode = TabSizeMode.Fixed

h