473,809 Members | 2,742 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what is the code for restoring application from sys tray

Hi,

i've this code that minimize application to sys tray i managed to hide the
application to the sys tray but i don't know how to bring it up back by
double cliking the sys tray icon

this is the code for the hide

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

if (this.WindowSta te == FormWindowState .Normal)
{

this.Hide();

}
Jun 8 '06 #1
6 1280
Avi G wrote:
application to the sys tray but i don't know how to bring it up back by
double cliking the sys tray icon


How about this (watch for typos):

private void SysTrayIcon_Mou seDoubleClick(. ..)
{
if (this.WindowSta te == FormWindowState .Normal)
{
this.Hide();
}
else
{
if (this.WindowSta te == FormWindowState .Minimized)
{
this.Visible = true;
}
}
}

Jun 8 '06 #2
i try this and it's not coming back from the Sys Tray, the problem is that
when i minimize the form1 it doesn't go to the tool bar it minimized to the
Sys Tray.

"Chris Dunaway" wrote:
Avi G wrote:
application to the sys tray but i don't know how to bring it up back by
double cliking the sys tray icon


How about this (watch for typos):

private void SysTrayIcon_Mou seDoubleClick(. ..)
{
if (this.WindowSta te == FormWindowState .Normal)
{
this.Hide();
}
else
{
if (this.WindowSta te == FormWindowState .Minimized)
{
this.Visible = true;
}
}
}

Jun 8 '06 #3
Chris Dunaway wrote:
How about this (watch for typos):

private void SysTrayIcon_Mou seDoubleClick(. ..)
{
if (this.WindowSta te == FormWindowState .Normal)
{
this.Hide();
}
else
{
if (this.WindowSta te == FormWindowState .Minimized)
{
this.Visible = true;
}
}
}


That might not work since the form is hidden, not minimized.

Try:
if (this.Visible == true)
{
this.Hide();
}
else
{
this.Show();
}

I think that should work....

Dan Manges
Jun 8 '06 #4
Mel
Try this

if (this.WindowSta te != FormWindowState .Normal)

this.WindowStat e = FormWindowState .Normal;

this.Opacity = 100;
this.TopMost = true;
this.Show();

"Avi G" <Av**@discussio ns.microsoft.co m> wrote in message
news:0E******** *************** ***********@mic rosoft.com...
i try this and it's not coming back from the Sys Tray, the problem is that
when i minimize the form1 it doesn't go to the tool bar it minimized to
the
Sys Tray.

"Chris Dunaway" wrote:
Avi G wrote:
> application to the sys tray but i don't know how to bring it up back by
> double cliking the sys tray icon
>


How about this (watch for typos):

private void SysTrayIcon_Mou seDoubleClick(. ..)
{
if (this.WindowSta te == FormWindowState .Normal)
{
this.Hide();
}
else
{
if (this.WindowSta te == FormWindowState .Minimized)
{
this.Visible = true;
}
}
}

Jun 8 '06 #5
can you give me the right code for those BallonsTips?

"Avi G" wrote:
i try this and it's not coming back from the Sys Tray, the problem is that
when i minimize the form1 it doesn't go to the tool bar it minimized to the
Sys Tray.

"Chris Dunaway" wrote:
Avi G wrote:
application to the sys tray but i don't know how to bring it up back by
double cliking the sys tray icon


How about this (watch for typos):

private void SysTrayIcon_Mou seDoubleClick(. ..)
{
if (this.WindowSta te == FormWindowState .Normal)
{
this.Hide();
}
else
{
if (this.WindowSta te == FormWindowState .Minimized)
{
this.Visible = true;
}
}
}

Jun 8 '06 #6
yes,it's working great.Thanks

"Dan Manges" wrote:
Chris Dunaway wrote:
How about this (watch for typos):

private void SysTrayIcon_Mou seDoubleClick(. ..)
{
if (this.WindowSta te == FormWindowState .Normal)
{
this.Hide();
}
else
{
if (this.WindowSta te == FormWindowState .Minimized)
{
this.Visible = true;
}
}
}


That might not work since the form is hidden, not minimized.

Try:
if (this.Visible == true)
{
this.Hide();
}
else
{
this.Show();
}

I think that should work....

Dan Manges

Jun 8 '06 #7

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

Similar topics

1
3715
by: Greg Merideth | last post by:
Is there a way via c# to hook a system tray application into the windows keyboard que globally so that when the application is running and you press, say, control-alt-shift-f11 the system tray app could respond to that keypress (much in the way my pgp app encrypts on ctrl-alt-e) even though its minimized and your in a different app? I've got an app thats a system tray and while its easy to access the data I'm just trying to add an extra...
0
1453
by: Vinay Agarwal | last post by:
Hello, I am writing an application that wants to monitor another application's state (on the same computer). This other application is a commercial application and I do not have access to its source. The state of this other application is clearly visible through its Notify icon in the system tray which changes with the state change. I have following two questions with two different approaches to this monitoring: 1. Is it possible to...
10
3145
by: Crouchie1998 | last post by:
Hello To All You Real Programmers Out There!! There is an application called: "Tray It" Webpage: ---------- http://www.teamcti.com/trayit/trayit.htm Direct Download:
1
2066
by: Janiv Ratson | last post by:
Hello, I have an MFC MDI application and a Windows Forms (2.0) Tray Icon application. I want to run a command on the tray application via my MFC application. There is a "Register" context menu command on the tray icon application. I want to call the Register command from my MFC MDI application. I thought of a windows message. How do I do it?
4
6135
by: Octavius Khan | last post by:
I have an application that runs in the system tray and I use global hotkeys to perform functions. When certain hotkeys are pressed, my system tray application may display a message box and sometimes a balloontip, but then focus is taken away from the application the user is using when this happens. How can I return focus to the original application? For example, let's say the user is using Notepad and then presses Ctrl-F9. This causes...
10
2191
by: nagar | last post by:
I noticed this behavior in a C# application. For its nature the applications stays mainly minimized to the tray icons As soon as it's launched the application responds normally. After a while, when I double click on the tray icon to show the window or I type a shortcut to open a new dialog (which also contains third-part controls) it takes much longer to open (even 3-5 seconds). How is that? Is there a way to avoid this behavior and keep...
1
1390
by: Zamdrist | last post by:
Trying to get my tray icon application to work as expected. Normally when you close an opened try icon application it minimizes to the tray. I have that part working by interrupting the close even in the Closing event by using e.Cancel = True. Unfortunately this also seems to interfere with closing the application when you shut down windows...windows won't shutdown until I explicit close my tray icon application, using a context menu...
1
5643
by: =?Utf-8?B?RW5naW5lZXJpaw==?= | last post by:
I have an application which uses a notification icon in the system tray. When the application is closed the notification icon remains in the system tray until I hover over it with the mouse. How can I refresh the system tray to remove the notify icon when the app closes?
4
4719
by: =?Utf-8?B?a3RwbW01?= | last post by:
I've got a basic system tray application running now. The primary focus of this application will be to get data from a remote db, and display it to the user. Iam a newbie in the Windows programming world so I hope my questions are not too dump. My questions are: * Is it better/faster to have it read directly from a remote db or should I have it read an xml file from a remote location, store the xml file on the hard drive, and read from...
0
9721
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
10637
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
10376
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...
1
10379
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10115
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
7660
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...
0
5687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3014
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.