473,508 Members | 2,079 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

NotifyIcon

Hi all,

I've a application where I need to use NotifyIcon in a other way round. My normal windows application sometimes has to collect data. In this case I want to hide all formulares and just show a icon in the system tray.
I've added a NotifyIcon and a button to a form:

private void button1_Click(object sender, EventArgs e)
{
this.Visible = false;
notifyIcon1.Visible = true;
}

click on the button hides the formular (perfect) but it also hides the icon in the system tray (not what I intended :-()
any idea ?

thanx
Feb 11 '08 #1
3 3264
Hi,

What you mean with hide the Icon in the system tray?

IIRC the way of doing it is to make the window minimized.

Take a look at my post here http://www.thescripts.com/forum/thread265639.html
--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"Peter Holschbach" <ma*****@thisaddress.dewrote in message news:fo**********@news.citykom.de...
Hi all,

I've a application where I need to use NotifyIcon in a other way round. My normal windows application sometimes has to collect data. In this case I want to hide all formulares and just show a icon in the system tray.
I've added a NotifyIcon and a button to a form:

private void button1_Click(object sender, EventArgs e)
{
this.Visible = false;
notifyIcon1.Visible = true;
}

click on the button hides the formular (perfect) but it also hides the icon in the system tray (not what I intended :-()
any idea ?

thanx
Feb 11 '08 #2
Peter Holschbach skrev:
Hi all,

I've a application where I need to use NotifyIcon in a other way round.
My normal windows application sometimes has to collect data. In this
case I want to hide all formulares and just show a icon in the system tray.
I've added a NotifyIcon and a button to a form:

private void button1_Click(object sender, EventArgs e)
{
this.Visible = false;
notifyIcon1.Visible = true;
}

click on the button hides the formular (perfect) but it also hides the
icon in the system tray (not what I intended :-()
any idea ?
Wild guess: Set notify icon visible first, and then perform a hide().
I guess using Hide() does a better job than just setting the visible
variable.
The notifyIcon1 Click action is of course this.show().

notifyIcon1.Visible = true;
this.Hide();

--
Bjørn Brox
Feb 12 '08 #3
Peter Holschbach wrote:
Hi all,

I've a application where I need to use NotifyIcon in a other way
round. My normal windows application sometimes has to collect data.
In this case I want to hide all formulares and just show a icon in
the system tray.
I've added a NotifyIcon and a button to a form:

private void button1_Click(object sender, EventArgs e)
{
this.Visible = false;
notifyIcon1.Visible = true;
}

click on the button hides the formular (perfect) but it also hides
the icon in the system tray (not what I intended :-()
any idea ?
What if the NotifyIcon wasn't parented to the Form? Setting Visible false
on a container automatically overrides Visible for all children (the
children will remember the setting but will not use it until the parent
becomes Visible=true again).
>
thanx

Feb 12 '08 #4

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

Similar topics

5
7347
by: Phil Galey | last post by:
VB.NET 2002 on Windows 2000 SP 3 When I start my program, the NotifyIcon appears in the tray, as it should. However, when I close the program, the NotifyIcon remains until I hover over it with...
0
1577
by: petterl | last post by:
I have tried to find the error in the code below but I always get " An unhandled exception of type 'System.NullReferenceException' occurred in Unknown Module. Additional information: Object...
2
513
by: Rob Mayo | last post by:
OK, maybe this is my opinion, maybe these are bugs. Given the folowing: I have a NotifyIcon on my Form, a Context menu associated with the NotifyIcon, and a MenuItem on the ContextMenu set as...
0
3313
by: Mike Allen | last post by:
Hi Everyone, My problem concerns ContextMenus. It's easy enough to create one and apply it to a NotifyIcon. When it's compiled and run, it works beautifully. Right click and there you are. But I...
3
10971
by: Glen | last post by:
Can anyone tell me if there is a workable method to get the mouse cursor position on the screen or the NotifyIcon position? I need to display a context menu for the NotifyIcon when clicked and I'd...
2
2908
by: Derrick | last post by:
I've been working on an application which has a NotifyIcon (system tray icon), and a corresponding ContextMenu. I want to be able to update this menu dynamically. However, when I make changes to...
2
9638
by: Amjad | last post by:
Hi, I'm using the NotifyIcon to process some text files in the background periodically. I want to display one icon in the task bar when the program is in stand by mode, and I want to display...
0
486
by: nospam | last post by:
I have an application that is made up of a single module for my global variables and then multiple classes. There is no form. I am using a notifyicon as my notification(Basically different...
2
2125
by: JR | last post by:
Hi, I need to change the notifyicon in a countdown. after about 3000-5000 times there is an error. Here is all the code. what is wrong please help
1
4275
by: \Ji Zhou [MSFT]\ | last post by:
Hello Jason, Thanks for using Microsoft Newsgroup Support Service, my name is Ji Zhou and I will be working on this issue with you. I have tried to but cannot reproduce your issue on my side....
1
7049
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...
0
7499
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...
0
5631
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,...
1
5055
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...
0
4709
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...
0
3199
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3186
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1561
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 ...
1
767
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.