473,320 Members | 2,071 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,320 software developers and data experts.

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_MouseDoubleClick(object sender,
MouseEventArgs e)
{

if (this.WindowState == FormWindowState.Normal)
{

this.Hide();

}
Jun 8 '06 #1
6 1248
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_MouseDoubleClick(...)
{
if (this.WindowState == FormWindowState.Normal)
{
this.Hide();
}
else
{
if (this.WindowState == 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_MouseDoubleClick(...)
{
if (this.WindowState == FormWindowState.Normal)
{
this.Hide();
}
else
{
if (this.WindowState == FormWindowState.Minimized)
{
this.Visible = true;
}
}
}

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

private void SysTrayIcon_MouseDoubleClick(...)
{
if (this.WindowState == FormWindowState.Normal)
{
this.Hide();
}
else
{
if (this.WindowState == 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.WindowState != FormWindowState.Normal)

this.WindowState = FormWindowState.Normal;

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

"Avi G" <Av**@discussions.microsoft.com> wrote in message
news:0E**********************************@microsof t.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_MouseDoubleClick(...)
{
if (this.WindowState == FormWindowState.Normal)
{
this.Hide();
}
else
{
if (this.WindowState == 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_MouseDoubleClick(...)
{
if (this.WindowState == FormWindowState.Normal)
{
this.Hide();
}
else
{
if (this.WindowState == 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_MouseDoubleClick(...)
{
if (this.WindowState == FormWindowState.Normal)
{
this.Hide();
}
else
{
if (this.WindowState == 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
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...
0
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...
10
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
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...
4
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...
10
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,...
1
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...
1
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...
4
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.