473,847 Members | 2,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

minimize application to sys tray

Hi,

i've created an application and i want it to be minimized to the sys tray,
how i do it?
if you can direct me step by step even with create a small application and
put it in the sys tray

Thanks
Jun 6 '06 #1
8 4554
Avi,

Check out the NotifyIcon class. The about page for the class
documentation in MSDN has an example which will show you what you are trying
to do.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Avi G" <Av**@discussio ns.microsoft.co m> wrote in message
news:83******** *************** ***********@mic rosoft.com...
Hi,

i've created an application and i want it to be minimized to the sys tray,
how i do it?
if you can direct me step by step even with create a small application and
put it in the sys tray

Thanks

Jun 6 '06 #2
ok i found half way, this is the code that when i press double click on the
sys tray icon the application minimized

private void notifyIcon1_Mou seDoubleClick(o bject sender,
MouseEventArgs e)
{
if (this.WindowSta te == FormWindowState .Normal)
this.WindowStat e = FormWindowState .Minimized;

// Activate the form.
this.Activate() ;
}

now i want the code that if i press again double click on the sys tray icon
it will lunch back the application and if the application is lunch and i
press the sys tray icon again it will minimized, how i do it?

Thanks

"Nicholas Paldino [.NET/C# MVP]" wrote:
Avi,

Check out the NotifyIcon class. The about page for the class
documentation in MSDN has an example which will show you what you are trying
to do.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Avi G" <Av**@discussio ns.microsoft.co m> wrote in message
news:83******** *************** ***********@mic rosoft.com...
Hi,

i've created an application and i want it to be minimized to the sys tray,
how i do it?
if you can direct me step by step even with create a small application and
put it in the sys tray

Thanks


Jun 6 '06 #3
Hello Avi,

Just reverse operation

if (this.WindowSta te == FormWindowState .Minimized)
this.WindowStat e = FormWindowState .Normal;
AG> ok i found half way, this is the code that when i press double click
AG> on the sys tray icon the application minimized
AG>
AG> private void notifyIcon1_Mou seDoubleClick(o bject sender,
AG> MouseEventArgs e)
AG> {
AG> if (this.WindowSta te == FormWindowState .Normal)
AG> this.WindowStat e = FormWindowState .Minimized;
AG> // Activate the form.
AG> this.Activate() ;
AG> }
AG> now i want the code that if i press again double click on the sys
AG> tray icon it will lunch back the application and if the application
AG> is lunch and i press the sys tray icon again it will minimized, how
AG> i do it?
AG>
AG> Thanks
AG>
AG> "Nicholas Paldino [.NET/C# MVP]" wrote:
AG>
Avi,

Check out the NotifyIcon class. The about page for the class
documentation in MSDN has an example which will show you what you are
trying to do.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"Avi G" <Av**@discussio ns.microsoft.co m> wrote in message
news:83******** *************** ***********@mic rosoft.com...
Hi,

i've created an application and i want it to be minimized to the sys
tray,
how i do it?
if you can direct me step by step even with create a small
application and
put it in the sys tray
Thanks

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Jun 6 '06 #4
i try your suggestion earlier but it cannot work like that

private void notifyIcon1_Mou seDoubleClick(o bject sender,
MouseEventArgs e)
{
if (this.WindowSta te == FormWindowState .Normal)
this.WindowStat e = FormWindowState .Minimized;
this.Activate() ;

if (this.WindowSta te == FormWindowState .Minimized)
this.WindowStat e = FormWindowState .Normal;
this.Activate() ;

}

if i try this it cannot minimized or normal because he do the code
together, any other suggestion

"Michael Nemtsev" wrote:
Hello Avi,

Just reverse operation

if (this.WindowSta te == FormWindowState .Minimized)
this.WindowStat e = FormWindowState .Normal;
AG> ok i found half way, this is the code that when i press double click
AG> on the sys tray icon the application minimized
AG>
AG> private void notifyIcon1_Mou seDoubleClick(o bject sender,
AG> MouseEventArgs e)
AG> {
AG> if (this.WindowSta te == FormWindowState .Normal)
AG> this.WindowStat e = FormWindowState .Minimized;
AG> // Activate the form.
AG> this.Activate() ;
AG> }
AG> now i want the code that if i press again double click on the sys
AG> tray icon it will lunch back the application and if the application
AG> is lunch and i press the sys tray icon again it will minimized, how
AG> i do it?
AG>
AG> Thanks
AG>
AG> "Nicholas Paldino [.NET/C# MVP]" wrote:
AG>
Avi,

Check out the NotifyIcon class. The about page for the class
documentation in MSDN has an example which will show you what you are
trying to do.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"Avi G" <Av**@discussio ns.microsoft.co m> wrote in message
news:83******** *************** ***********@mic rosoft.com...

Hi,

i've created an application and i want it to be minimized to the sys
tray,
how i do it?
if you can direct me step by step even with create a small
application and
put it in the sys tray
Thanks

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

Jun 6 '06 #5
Hello Avi,

Check the current state and use only one case

private void notifyIcon1_Mou seDoubleClick(o bject sender,MouseEve ntArgs e)
{
if (this.WindowSta te == FormWindowState .Normal)
{
this.WindowStat e = FormWindowState .Minimized;
}
else
if (this.WindowSta te == FormWindowState .Minimized)
{
this.WindowStat e = FormWindowState .Normal
}

this.Activate() ;
}

AG> i try your suggestion earlier but it cannot work like that
AG>
AG> private void notifyIcon1_Mou seDoubleClick(o bject sender,
AG> MouseEventArgs e)
AG> {
AG> if (this.WindowSta te == FormWindowState .Normal)
AG> this.WindowStat e = FormWindowState .Minimized;
AG> this.Activate() ;
AG>
AG> if (this.WindowSta te == FormWindowState .Minimized)
AG> this.WindowStat e = FormWindowState .Normal;
AG> this.Activate() ;
AG> }
AG>
AG> if i try this it cannot minimized or normal because he do the code
AG> together, any other suggestion
AG>
AG> "Michael Nemtsev" wrote:
AG>
Hello Avi,

Just reverse operation

if (this.WindowSta te == FormWindowState .Minimized) this.WindowStat e =
FormWindowState .Normal;

AG> ok i found half way, this is the code that when i press double
click
AG> on the sys tray icon the application minimized
AG>
AG> private void notifyIcon1_Mou seDoubleClick(o bject sender,
AG> MouseEventArgs e)
AG> {
AG> if (this.WindowSta te == FormWindowState .Normal)
AG> this.WindowStat e = FormWindowState .Minimized;
AG> // Activate the form.
AG> this.Activate() ;
AG> }
AG> now i want the code that if i press again double click on the sys
AG> tray icon it will lunch back the application and if the
application
AG> is lunch and i press the sys tray icon again it will minimized,
how
AG> i do it?
AG>
AG> Thanks
AG>
AG> "Nicholas Paldino [.NET/C# MVP]" wrote:
AG>
Avi,

Check out the NotifyIcon class. The about page for the class
documentation in MSDN has an example which will show you what you
are trying to do.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"Avi G" <Av**@discussio ns.microsoft.co m> wrote in message
news:83******** *************** ***********@mic rosoft.com...
> Hi,
>
> i've created an application and i want it to be minimized to the
> sys
> tray,
> how i do it?
> if you can direct me step by step even with create a small
> application and
> put it in the sys tray
> Thanks

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents
do not cease to be insipid." (c) Friedrich Nietzsche

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Jun 6 '06 #6
thanks it's working, now last question if i want to minimize the application
to the sys tray directly and not to the toolbar and be able to lunch it back
from the sys tray icon and minimize it back to the sys tray, how i do it?

"Michael Nemtsev" wrote:
Hello Avi,

Check the current state and use only one case

private void notifyIcon1_Mou seDoubleClick(o bject sender,MouseEve ntArgs e)
{
if (this.WindowSta te == FormWindowState .Normal)
{
this.WindowStat e = FormWindowState .Minimized;
}
else
if (this.WindowSta te == FormWindowState .Minimized)
{
this.WindowStat e = FormWindowState .Normal
}

this.Activate() ;
}

AG> i try your suggestion earlier but it cannot work like that
AG>
AG> private void notifyIcon1_Mou seDoubleClick(o bject sender,
AG> MouseEventArgs e)
AG> {
AG> if (this.WindowSta te == FormWindowState .Normal)
AG> this.WindowStat e = FormWindowState .Minimized;
AG> this.Activate() ;
AG>
AG> if (this.WindowSta te == FormWindowState .Minimized)
AG> this.WindowStat e = FormWindowState .Normal;
AG> this.Activate() ;
AG> }
AG>
AG> if i try this it cannot minimized or normal because he do the code
AG> together, any other suggestion
AG>
AG> "Michael Nemtsev" wrote:
AG>
Hello Avi,

Just reverse operation

if (this.WindowSta te == FormWindowState .Minimized) this.WindowStat e =
FormWindowState .Normal;

AG> ok i found half way, this is the code that when i press double
click
AG> on the sys tray icon the application minimized
AG>
AG> private void notifyIcon1_Mou seDoubleClick(o bject sender,
AG> MouseEventArgs e)
AG> {
AG> if (this.WindowSta te == FormWindowState .Normal)
AG> this.WindowStat e = FormWindowState .Minimized;
AG> // Activate the form.
AG> this.Activate() ;
AG> }
AG> now i want the code that if i press again double click on the sys
AG> tray icon it will lunch back the application and if the
application
AG> is lunch and i press the sys tray icon again it will minimized,
how
AG> i do it?
AG>
AG> Thanks
AG>
AG> "Nicholas Paldino [.NET/C# MVP]" wrote:
AG>
> Avi,
>
> Check out the NotifyIcon class. The about page for the class
> documentation in MSDN has an example which will show you what you
> are trying to do.
>
> Hope this helps.
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mv*@spam.guard. caspershouse.co m
> "Avi G" <Av**@discussio ns.microsoft.co m> wrote in message
> news:83******** *************** ***********@mic rosoft.com...
>> Hi,
>>
>> i've created an application and i want it to be minimized to the
>> sys
>> tray,
>> how i do it?
>> if you can direct me step by step even with create a small
>> application and
>> put it in the sys tray
>> Thanks
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents
do not cease to be insipid." (c) Friedrich Nietzsche

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

Jun 6 '06 #7
Avi G wrote:
thanks it's working, now last question if i want to minimize the application
to the sys tray directly and not to the toolbar and be able to lunch it back
from the sys tray icon and minimize it back to the sys tray, how i do it?

this.Hide() and this.Show()

<...>
JB
Jun 7 '06 #8
i managed to hide the application but not to restore it back, why what i
wrong with my code?

private void notifyIcon1_Mou seDoubleClick(o bject sender,
MouseEventArgs e)
{

if (this.WindowSta te == FormWindowState .Normal)
{
this.Hide();
}

else
if (this.WindowSta te == FormWindowState .Minimized)

{

this.Show();

}

}

"John B" wrote:
Avi G wrote:
thanks it's working, now last question if i want to minimize the application
to the sys tray directly and not to the toolbar and be able to lunch it back
from the sys tray icon and minimize it back to the sys tray, how i do it?

this.Hide() and this.Show()

<...>
JB

Jun 7 '06 #9

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

Similar topics

2
8153
by: varadha | last post by:
Hi, i want to create a VC++ application that minimizes to system tray when i minimize it. This application should be running in the background and doing it process(Just like Yahoo messanger which minimizes to the syetem tray when we minimize it). Can u help me out in this.
4
17397
by: mphanke | last post by:
Hi, how can I minimize an application to the tray? Snippets welcome. Martin
1
377
by: Xarky | last post by:
Hi, I followed the follwoing post to minimize application to system tray. http://groups.google.com/groups?hl=mt&lr=&threadm=ODOAWyDwEHA.3084%40TK2MSFTNGP10.phx.gbl&prev=/groups%3Fnum%3D25%26hl%3Dmt%26lr%3D%26group%3Dmicrosoft.public.dotnet.languages.csharp%26start%3D25 Now, when application is in system tray, I tried to double click on it to open, but its not opening. I added the following code private void trayIcon_DoubleClick(object...
3
4967
by: Maka Sili | last post by:
Hi, My VC++ application does not have a titlebar (and therefore no System menu, no minimize, no maximize and no close button). We have a custom button for minimize and close. When the app is in normal/maximized view, clickinng on the taskbar entry does not minimize the application. Normally (with apps with titlebar), the application would minimize when you click on
4
4105
by: steve | last post by:
hi all, i was wondering how is it possible to add an extra box ( i think they are called boxes: upper right corner ...) in a form that will minimize it in the system tray? You know some applications have a 4th one (apart from the square , bar and X ) which contains a dot and once u click it minimizes the application to the tray. TIA
5
2128
by: pamelafluente | last post by:
Hello guys, I have done a small utility and would like that an image be displayed on the the windows tray (on bottom-right of the screen). Also I would like that when one clicks on X (close) the application be minimized and only the tray icon be visible. When one clicks on the tray icon the application shoud return to its normal status (normal/maximized, depending how it was when was minimized).
1
2862
by: zakhirn | last post by:
Anyone have code that creates a button that will Minimize Excel to the system tray. I do not need anything complicated like changing the minimize button or the close button to a minimize to tray button. I have a Form that pops up when excel loads, and I will add a command button called Minimize that I just want to minimize excel to the system tray.
0
1574
by: =?Utf-8?B?U2VudGhpbCBTdWJyYW1hbmlhbg==?= | last post by:
Our requirement is to run the vb dot net application in minimize mode with system tray icon in the remote machine (remote desktop). When we running in the remote desktop window is showing in normal mode without minimize mode. when we running in the console mode our application window is minimized without any issues, when we executed the same in the remote desktop application window is not minimized.
3
14298
by: Jimmy | last post by:
I'm kinda newbie to python and wxPython. Now I'm confronting a thorny problem: how can I make my program minimize to the taskbar represented as an ico, and when there is some message from network coming, it will pop out?
0
9892
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9734
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10995
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10654
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10347
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7888
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4130
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3168
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.