|
-
August 13th, 2003, 12:16 PM
#1
How to call an icon to the systray.
I am trying to call two different icons to the systray. When you DblClick on the current icon in the systray, it changes the icon. Right now I am calling them from the apps directory, but I would rather call them from inside the app. I.E. picture control.
Private Function ChangeState()
If blnEnabled Then
blnEnabled = False
cmd_Enable.Caption = "Enable"
mnuEnable.Caption = "Enable"
Set Me.Icon = LoadPicture(App.Path & "\Images\disabled.ico") <----
ByPass = True
Else
blnEnabled = True
cmd_Enable.Caption = "Disable"
mnuEnable.Caption = "Disable"
Set Me.Icon = LoadPicture(App.Path & "\Images\enabled.ico") <---
ByPass = False
End If
UpdateIcon
End Function
-
August 13th, 2003, 10:31 PM
#2
You may add 2 image controls and place the icons on them at design time. At run time just set the form's icon to the image picture depending upon the state.
Code:
Private Function ChangeState()
If blnEnabled Then
blnEnabled = False
cmd_Enable.Caption = "Enable"
mnuEnable.Caption = "Enable"
Set Me.Icon = imgDisabled.Picture
ByPass = True
Else
blnEnabled = True
cmd_Enable.Caption = "Disable"
mnuEnable.Caption = "Disable"
Set Me.Icon = imgEnabled.Picture
ByPass = False
End If
UpdateIcon
End Function
Hope it will help you
-
August 14th, 2003, 08:55 AM
#3
Thanks rxbagain, It worked great. I thought for sure I had tried that, but I guess not.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|