Display a control into the status bar

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hello,

I currently develop an application which runs in background. I would like to
put at the place of the notifyicon, a label, which displays information about
this application.

Any Ideas?
Thanks.
 
Thanks, but I think the notifyIcon just can display icon?! I want to display
a label or textbox which contains informations about the application...
 
Well you can't without some pretty severe Win32 hacking... how often do you
see this, after all?

However, you could use GDI+ to draw the icon, either using a tiny font (and
abbreviations!), or by writing a scrolling marquee implementation... noddy
(colour changing) example follows, but I haven't tested it much : it might
leak like a sponge for all I know!

using System;
using System.Windows.Forms;
using System.Drawing;
class Program {
static Random rand = new Random();
static Icon GetIcon() {
using (Bitmap bmp = new Bitmap(32, 32)) {
using (Graphics g = Graphics.FromImage(bmp))
using (SolidBrush sb = new SolidBrush(Color.FromArgb(255,
rand.Next(255), rand.Next(255), rand.Next(255)))) {
g.FillEllipse(sb, 0, 0, 30, 30);
}
return Icon.FromHandle(bmp.GetHicon());
}
}
static void UpdateIcon(NotifyIcon ni) {
Icon old = ni.Icon;
ni.Icon = GetIcon();
if (old != null) old.Dispose();
}
static void Main() {
using (Form f = new Form())
using (Timer t = new Timer())
using (NotifyIcon ni = new NotifyIcon()) {
ni.Visible = true;
t.Interval = 1000;
t.Tick += delegate { UpdateIcon(ni); };
f.Load += delegate { t.Start(); };
f.FormClosing += delegate { t.Stop(); };
f.ShowDialog();
}
}
}
 
Hi,

Yes, it's only a icon you can show. AFAIK there is no way of doing what you
want with the framework's provided tools.
You can either use a third party control or find out to do it :) , I advise
you to look into the unmanaged world first. I have been around this NG a
couple of years and do not remember anybody with this issue before
 
Thanks for the answers,
but it's not what I have need. I've found a exemple in C++ on the Web which
displays a progressbar in the taskbar.
I try to modify and put it into a DLL.
I hope it will process… ?!?
 
Hi,


Franz said:
Thanks for the answers,
but it's not what I have need. I've found a exemple in C++ on the Web
which
displays a progressbar in the taskbar.
I try to modify and put it into a DLL.
I hope it will process. ?!?

I do remember some programs like that, but I had never done it before.
IMO you will be much better if you find a third party control that
implements it. If you plan to do it on your own you will have to work hard
with win32 API
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top