Solved

Text in System Tray

Posted on 2001-06-17
18
229 Views
Last Modified: 2010-05-02
I'm working on making a clock (like the system clock, except made by me), and I really need to know how I can add text to the system tray.  I found out how to add icons, but not text!

Please help!  Any comments or anything would be appreciated.

Preferably, I'd like it so that I can treat it almost like a label, or text box, something that I can easily edit the colors, background colors, etc.  Like:

statusbartext.backcolor = (whatever)

and

statusbartext.text (or caption) = "whatever"

Thank you so much!

75 pts is all I got :(

-Sam
0
Comment
Question by:samsonite_VB
  • 4
  • 4
  • 3
  • +4
18 Comments
 
LVL 15

Accepted Solution

by:
ameba earned 38 total points
ID: 6200653
>I found out how to add icons, but not text!
You should add icon to systray.  Here is how to modify icon:

' Form1, add textbox, picturebox and Imagelist (dimensions 16x16)
Option Explicit

Private Sub Form_Load()
   Picture1.AutoRedraw = True
   Picture1.BorderStyle = 0
   Picture1.Width = 16 * 15
   Picture1.Height = 16 * 15
   Picture1.Font = "Small Fonts"
   Picture1.FontSize = 6
   Picture1.BackColor = vbWhite
End Sub

Private Sub Text1_Change()
   On Error Resume Next

   Picture1.Cls
   Picture1.Print Text1.Text
   ImageList1.ListImages.Remove "status"
   ImageList1.ListImages.Add , "status", Picture1.Image

   Set Me.Icon = ImageList1.ListImages("status").ExtractIcon

End Sub

Please, do not accept this comment 'as answer' if it isn't for A grade.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6200967
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6201291
For a different approach: http://www.geocities.com/timcottee/downloads/traywindow.zip

This sample project allows you to place an entire form in the system tray and have buttons/labels etc active within it.
0
 
LVL 4

Expert Comment

by:nutwiss
ID: 6201526
tim - your link's dead....

that's geoshitties for you :)
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6201555
nutwiss, this happens many times. If you go to http://www.geocities.com/TimCottee and click the downloads link you should get there. Don't ask me why the link is dead, I copied it straight off the page myself!
0
 
LVL 15

Expert Comment

by:ameba
ID: 6201599
It's problem with geocities server. To download file, right-click and select 'Save Target As'

I found their mirror server with prefix 'us.share' to always work with zip files:
http://us.share.geocities.com/timcottee/downloads/traywindow.zip
0
 
LVL 15

Expert Comment

by:ameba
ID: 6201613
>mirror server with prefix 'us.share' to always work

This is the first time that doesn't work for me.  :-)
So, the only solution is: right-click and select 'Save Target As'
0
 
LVL 4

Expert Comment

by:nutwiss
ID: 6201632
btw tim, your code works, but, it has to be said, shows little regard for windows standards - it's kind of rude to simply replace the system tray with your own window, don't you think? ;>>
0
 

Author Comment

by:samsonite_VB
ID: 6201889
Tim, your program is nice... but is there any way to get it NOT to take over the whole system tray?

It'd be awesome if It would just stick itself to the right of the last icon.

-Sam
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 43

Expert Comment

by:TimCottee
ID: 6201960
I am going to have a look at how this might be possible, either to do as you suggest or to place it in the taskbar as a seperate window.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6207219
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7136219
Hi samsonite_VB,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Split points between: ameba and Richie_Simonetti

samsonite_VB, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7138131
I didn't try his links but, what about Tim?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7138956
hi Richie_Simonetti,
I have to base my original recommendation on available info.  And I have expert input re TimCottee's solution already (see the nutwiss post of 06/18/2001 02:54AM).

Tim, want to add anything?
-- Dan
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7138980
Ok. My apologize.
Cheers
(keep the hard work, Dan. Thank you)
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 7140124
nutwiss is right in what he says and as I don't really need the 100 points I am quite happy to leave it as suggested. Dan has recommended at least 10 other threads my way this morning so I am quite happy with that.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7140323
My new EE handle: Santa Claus :)
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7181558
Per recommendation, force-accepted.

Netminder
CS Moderator

Richie_Simonetti: points for you at http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20328617
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now