473,545 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Notify Icon show form

I have a utility that minimizes to the system tray.
When I double click or right-click and select restore I want to show the
window and for it to be the active window again.
I have tried
this.Show
this.Activate
this.BringToFro nt

But in all cases, the form just restores to the task bar and does not
show itself.

The only way I could do it was with the win23 api's
ShowWindowAsync and SetForegroundWi ndow.

This is fine and works as desired, I just wondered if I was missing
anything and there was a managed way to do it?

Cheers
JB
Nov 17 '05 #1
4 3446
Hmm, I haven't actually tried it, but from what I've seen it should just be
a call to Hide() to hide the form and then a call to Show() to bring it
back. What are you currently using to make the form go away?

Might look at:
http://www.codeproject.com/csharp/trayiconmenu01.asp

--
Adam Clauss
ca*****@tamu.ed u

"John B" <jb******@yahoo .com> wrote in message
news:42******** *************** @news.sunsite.d k...
I have a utility that minimizes to the system tray.
When I double click or right-click and select restore I want to show the
window and for it to be the active window again.
I have tried
this.Show
this.Activate
this.BringToFro nt

But in all cases, the form just restores to the task bar and does not show
itself.

The only way I could do it was with the win23 api's
ShowWindowAsync and SetForegroundWi ndow.

This is fine and works as desired, I just wondered if I was missing
anything and there was a managed way to do it?

Cheers
JB

Nov 17 '05 #2
psg
"John B" <jb******@yahoo .com> wrote in message
news:42******** *************** @news.sunsite.d k...
I have a utility that minimizes to the system tray.
When I double click or right-click and select restore I want to show the
window and for it to be the active window again.
I have tried
this.Show
this.Activate
this.BringToFro nt


for me this works:
*************** *************** ***
private void notifyIcon1_Mou seDown(object sender,
System.Windows. Forms.MouseEven tArgs e)
{
this.Show();
this.Activate() ;
if (this.WindowSta te == FormWindowState .Minimized)
{
this.WindowStat e = FormWindowState .Normal;
}
}

*************** *************** ***
additionally:
*************** *************** ***
// after Form initialisation
this.Resize += new EventHandler(Hi deForm);

void HideForm(object sender, EventArgs e)
{
if(this.WindowS tate == FormWindowState .Minimized)
{
this.Hide();
}
else this.Show();
}
*************** *************** ***

RGDS PSG
Nov 17 '05 #3
Adam Clauss wrote:
Hmm, I haven't actually tried it, but from what I've seen it should just be
a call to Hide() to hide the form and then a call to Show() to bring it
back. What are you currently using to make the form go away?

Might look at:
http://www.codeproject.com/csharp/trayiconmenu01.asp

this.Hide()

psg's suggestion fixed it though.
Thanks for your help.

JB
Nov 17 '05 #4
psg wrote:
"John B" <jb******@yahoo .com> wrote in message
news:42******** *************** @news.sunsite.d k...
I have a utility that minimizes to the system tray.
When I double click or right-click and select restore I want to show the
window and for it to be the active window again.
I have tried
this.Show
this.Activa te
this.BringToF ront

for me this works:
*************** *************** ***
private void notifyIcon1_Mou seDown(object sender,
System.Windows. Forms.MouseEven tArgs e)
{
this.Show();
this.Activate() ;
if (this.WindowSta te == FormWindowState .Minimized)
{
this.WindowStat e = FormWindowState .Normal;
}
}

*************** *************** ***
additionally:
*************** *************** ***
// after Form initialisation
this.Resize += new EventHandler(Hi deForm);

void HideForm(object sender, EventArgs e)
{
if(this.WindowS tate == FormWindowState .Minimized)
{
this.Hide();
}
else this.Show();
}
*************** *************** ***

RGDS PSG

Works beautifully.
Thanks
I didnt set the form.windowstat e, which is why it never brought it back up.

Cheers
JB
Nov 17 '05 #5

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

Similar topics

2
4686
by: shagshag | last post by:
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 ?
4
9933
by: Beenish Sahar Khan | last post by:
I want to start my application so that its notify icon is added to the system tray, i don't want to show any starting form. I want user to interact through the notify icon...just like MSN. Is there any way to do this? regards, beenish
3
2011
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 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...
5
15454
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 C# 2005) so that you can write click on the icon in the tray for options. I then captured the event for mouse clicks on the Notify Icon so that I...
2
4946
by: mr t | last post by:
Hi guys, I have a notify Icon, but when I call showBallonTip, the balloon does not show. any reason why? here is my call: Me.NotMemberServ.ShowBalloonTip(5000, "New Member IDs", iCountNew & " Member IDs Downloaded.", ToolTipIcon.Info) thanks in advance.
0
7487
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...
0
7680
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. ...
0
7778
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...
0
6003
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4966
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3459
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1908
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
1
1033
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
731
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...

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.