473,405 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Notify tray Icon

I know how to place a notify icon in the system tray and
how to hide the Form that owe the icon. The taskbar entry
button is hidden, ok, but I always get an entry for the
Form when I press "Alt+TAB". See my pb ?
Nov 15 '05 #1
2 4673
You probably don't even need the form at all. VS.NET automatically adds a
form to the project and adds Application.Run(new Form1()) to the static Main
method, but it's often totally unnecessary for a NotifyIcon application.
Example below. Note that it uses Application.Run() without a form parameter,
and the icon events can manipulate the Application state directly.

class MyApp
{
static NotifyIcon icon;

[STAThread]
static void Main()
{
icon = new NotifyIcon();
icon.Icon = new Icon("App.ico");
icon.Text = "Tooltip text here";
icon.Click += new EventHandler(Icon_Click);
icon.Visible = true;
Application.Run();
}

static void Icon_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Quit now?", "NotifyIcon",
MessageBoxButtons.YesNo) == DialogResult.Yes)
{
icon.Visible = false;
Application.Exit();
}
}
}

"shagshag" <sh**********@caramail.com> wrote in message
news:15*****************************@phx.gbl...
I know how to place a notify icon in the system tray and
how to hide the Form that owe the icon. The taskbar entry
button is hidden, ok, but I always get an entry for the
Form when I press "Alt+TAB". See my pb ?

Nov 15 '05 #2
Yeah ! Thanks a lot !
This was so simple. Backa Shagshag !!! =)

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Lalit | last post by:
Hi Friends, I have developed a Windows service. Now i need icon for this service in systray and context menu fo this icon. Can i do this? With regards, Lalit
3
by: jm | last post by:
Hi, I have a C# program that changes the notifyIcon during the program. What I have noticed is that sometimes when the program is over the old icon will still be in the system tray. But when i...
6
by: Neo | last post by:
i'd like to create an application which would run in the background, & there'd be an icon in the system tray (can use the notify icon). But HOW can i make the form invisible. What i'd like to do...
0
by: Mike Eaton | last post by:
Hi there, I have an app whose structure is as follows: a module calls a custom application context containing a notify icon and associated context menu, which in turn acts upon an instance of...
3
by: iwdu15 | last post by:
hi, im using this code to display a notifyicon object with information provided at runtime Protected Overrides Sub WndProc(ByRef m As Message) MyBase.WndProc(m) If m.Msg = WM_SYSCOMMAND...
3
by: Cylix | last post by:
I am going to make an application in monitor and do something on time. A part of it is an Notify icon(System Tray Icon), Which project type can I be used for Just showing the notify icon without...
5
by: =?Utf-8?B?cHJvZ2dlcg==?= | last post by:
I've written an application that can minimize to the tray and can reappear if you double click on the icon in the tray (ShowInTaskbar is set to false). I've also created a ContextMenuStrip (Visual...
1
by: ourxp | last post by:
Hi I have an idea but not quite sure how to implement it. I have a skeleton of a plug in architecture. My plans are to have the host use a notify icon and place it in the system tray. The plug...
1
by: namrataa | last post by:
i have a notify icon for our media player developed in wpf. included files are notify.cs,notify.resx,notify.designer.cs. i have also added a class file called app.cs . now the problem is how...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.