Code:
Private Sub Form_Load()
'the form must be fully visible before calling Shell_NotifyIcon
Me.Show
Me.Refresh
With nid
.cbSize = Len(nid)
.hwnd = Me.hwnd
.uId = vbNull
.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
.uCallBackMessage = WM_MOUSEMOVE
.hIcon = Me.Icon
.szTip = Label1.Caption & vbNullChar
End With
Shell_NotifyIcon NIM_ADD, nid
End Sub
As I've got my caption set to "00:00" that's what's displayed as a result of ".szTip = Label1.Caption & vbNullChar"
I was just wondering how to fix this problem, and how to get a popup to literally pop up in the corner as "the clock strikes"
Thanks
PS.
Code:
Private Sub Timer1_Timer()
Label1.Caption = Time
If Time >= "12:00" Then Label1.Caption = "Afternoon"
If Time <= "12:00" Then Label1.Caption = "Morning"
If Time >= "17:00" Then Label.Caption = "Evening"
If Time >= "20:00" Then Label.Caption = "Night"
End Sub
Code:
Private Sub Form_Load()
Label1.Caption = Time
If Time >= "12:00" Then Label1.Caption = "Afternoon"
If Time <= "12:00" Then Label1.Caption = "Morning"
If Time >= "17:00" Then Label.Caption = "Evening"
If Time >= "20:00" Then Label.Caption = "Night"
'the form must be fully visible before calling Shell_NotifyIcon
Me.Show
Me.Refresh
With nid
.cbSize = Len(nid)
.hwnd = Me.hwnd
.uId = vbNull
.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
.uCallBackMessage = WM_MOUSEMOVE
.hIcon = Me.Icon
.szTip = Label1.Caption & vbNullChar
End With
Shell_NotifyIcon NIM_ADD, nid
mPopupRestore.Visible = False
mPopupExit.Visible = False
End Sub