469,951 Members | 2,744 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,951 developers. It's quick & easy.

Notify Icon problem

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 any form?

What I mean is something like When you minimize the MSN Messager as a
tray icon.

I have tried a service project and application project, all these seems
cannot meet the goal.

Thank you for any advance.

Jan 25 '07 #1
3 1849
For a service, there is an option called something like
InteractWithDesktop that must be set in order for it to show a
notifyicon. But in order to show a form (remember, service = no UI)
then you'll probably have to use the System.Diagnostics.Process.Start()
method to show an external form (one that you pre-built).

Or you could try this - Start a windows application and build a blank
form (for demo purposes). Add a notifyIcon to the form and set the
appropriate settings, I would highly recommend adding some sort of
close method here, be it on a click or using a context menu - you'll
see why later. Then, add a module with a sub main block and set that
sub main as the startup object. Then do something like this:

Sub Main()
' Do whatever here first
Dim f as new BlankFormWithNotifyIcon()
Application.Run()
' Do shut down methods here
End Sub

When you instantiate your form (I believe) it will automagically show
the notify icon in the taskbar - if not you could just show the form
and set it's visibility to false. Just be sure to call
Application.Exit() somewhere in the app (like in the close method I
told you to add earlier) to abort/stop the Application.Run() call in
the sub main.

Let us know how this works,

Thanks,

Seth Rowe
On Jan 24, 9:43 pm, "Cylix" <cylix2...@gmail.comwrote:
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 any form?

What I mean is something like When you minimize the MSN Messager as a
tray icon.

I have tried a service project and application project, all these seems
cannot meet the goal.

Thank you for any advance.
Jan 25 '07 #2
"Cylix" <cy*******@gmail.comschrieb:
>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 any form?

Create a new project that contains a reference to
"System.Windows.Forms.dll". Add a component class to the project and place
a notifyicon component on it. Then add a 'Sub Main' that looks like this:

\\\
Public Sub Main()
Dim c As New Component1()
Application.Run()
End Sub
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jan 25 '07 #3
It works great!

Jan 26 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by shagshag | last post: by
3 posts views Thread by jm | last post: by
4 posts views Thread by Beenish Sahar Khan | last post: by
1 post views Thread by Rob | last post: by
reply views Thread by Mike Eaton | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.