|
-
Mar 22nd, 2004, 03:44 PM
#1
Thread Starter
Frenzied Member
Change form icon
I'm trying to change the form icon so that my taskbar icon changes. I'm using the following code:
VB Code:
Me.Icon = App.Path & "\clear.ico"
and I'm getting a "type mismatch" error on the ampersand. Is this not a legal path for the icon?
-
Mar 22nd, 2004, 03:53 PM
#2
Frenzied Member
I think you need to load it as a picture first...
MyVar = LoadPicture(App.Path & "\clear.ico")
Me.Icon = MyVar
Just a guess
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
-
Mar 22nd, 2004, 03:58 PM
#3
Thread Starter
Frenzied Member
Nope.... that didn't do it.
-
Mar 22nd, 2004, 04:05 PM
#4
Hyperactive Member
Well, the reason is that you don't LoadPicture into a variable
Just:
Form1.Icon = LoadPicture(imgPath)
cjqp
When your answer is the Arc Sin of 1.015, you should check your Pythagorean triple.
-
Mar 23rd, 2004, 03:29 AM
#5
Fanatic Member
why dont you just change the icon in the propertys box of the form to whatever icon you want.
Is this what you were looking for?
Cheers
-
Mar 23rd, 2004, 08:13 AM
#6
Thread Starter
Frenzied Member
Originally posted by laserman
why dont you just change the icon in the propertys box of the form to whatever icon you want.
Is this what you were looking for?
Cheers
Because I'm changing it at runtime.
-
Mar 23rd, 2004, 08:16 AM
#7
Thread Starter
Frenzied Member
Ok, cjqp's suggestion worked, but the icon in the taskbar does not get updated. Is there a way to refresh the taskbar?
-
Mar 23rd, 2004, 08:41 AM
#8
Frenzied Member
Have you tried making it invisible and visible straight after?
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
-
Mar 23rd, 2004, 10:25 AM
#9
Hyperactive Member
It depends on how you are adding the icon to the taskbar, whether by your own code or by a 3rd party control. Some controls will automatically update the taskbar icon, some will not. You could remove/add the icon again to the taskbar to update the icon.
cjqp
When your answer is the Arc Sin of 1.015, you should check your Pythagorean triple.
-
Mar 23rd, 2004, 11:42 AM
#10
Thread Starter
Frenzied Member
I'm using my own code... the code that is posted all the time for using system tray icons.
And no, I haven't tried making it visible/invisible.
Maybe I'll just add this in the next release. It's only going to change the icon for a split second anyways.
-
Mar 23rd, 2004, 12:37 PM
#11
Hyperactive Member
I don't know much about adding icons to the sys tray, but I don't think making it invisible/visible will help. But like I said, I don't know that aspect.
cjqp
When your answer is the Arc Sin of 1.015, you should check your Pythagorean triple.
-
Mar 23rd, 2004, 01:12 PM
#12
Thread Starter
Frenzied Member
I didn't think that would work either... probably why I haven't attempted to do it.
-
Mar 23rd, 2004, 01:56 PM
#13
Hyperactive Member
But removing the icon and re-adding it would work. Shouldn't be to hard if you have good code, just function calls.
cjqp
When your answer is the Arc Sin of 1.015, you should check your Pythagorean triple.
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
|