Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System Tray Icon with a number

Status
Not open for further replies.

mjk9564

Programmer
Apr 23, 2003
64
US
How can you create a system tray icon that is just a number or a picture with a number on top of it? Like you see in a lot of RAM programs or in weather bug.

I know how to create the system tray icon, but I was hoping for an easier way to this other than creating a different icon for every number.

I am monitoring a printer queue and displaying the pages in the queue, so there could be several hundred pages at times.
 
I don't know that there is adequate room to display a number in the hundreds in a system tray icon. Especially since the size of the icon is "limited". Have you thought of just modifying the tool tip text to display the count as the user hovers over the icon?


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
I think you can put a Form in the system tray. If i can find the downloaded source code, i will post it here.

------------------------------------------
The faulty interface lies between the chair and the keyboard.
 
I figured out how to do this. If anyone would like to know how I will post the code.

Thanks,
Matt
 
Crikey - I was sure that I posted a solution to this. Still, good to see you've figured out your own solution. Probably worth you posting yours, since future keyword searchers may find this thread, and then be sad that there isn't a solution here for them...
 
Sorry, it took so long I've been out of town on a start-up. Here you go if you have any questions just ask.

Be sure to set the picture box to autodraw = true. ilsPages is a image list control. If anyone has another way to do it I would love to see it.

'Clear the current picture
picSysTray.Cls

'Print the text
picSysTray.Print intTotPages

'Set the text as the picture
picSysTray.Picture = picSysTray.Image

'Clear the image list
ilsPages.ListImages.Clear

'Set the picture in the list image
ilsPages.ListImages.Add 1, , picSysTray.Picture

'free the picture memory
Set picSysTray.Picture = Nothing

'set the list image icon as the new form icon
Me.Icon = ilsPages.ListImages(1).ExtractIcon

'Change the tray icon
SetTrayIcon Me.Icon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top