Possible Duplicate:
What's the proper way to minimize to tray a C# WinForms app?
How can I create a program that runs in the background, and can be accessed via the Windows' "Notification Area" (Where the date and time are in the lower right hand corner)?
In other words, I want to be able to create a program that runs and can toggle between having a display window and not having a display window.
C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...
In the real sense it has no meaning or full form. It was developed by Dennis Ritchie and Ken Thompson at AT&T bell Lab. First, they used to call it as B language then later they made some improvement into it and renamed it as C and its superscript as C++ which was invented by Dr.
C is a general-purpose programming language created by Dennis Ritchie at the Bell Laboratories in 1972. It is a very popular language, despite being old. C is strongly associated with UNIX, as it was developed to write the UNIX operating system.
The C language was actually created to move the UNIX kernel code from assembly to a higher level language, which would do the same tasks with fewer lines of code. Oracle database development started in 1977, and its code was rewritten from assembly to C in 1983. It became one of the most popular databases in the world.
NotifyIcon
and a ContextMenuStrip
.Set the Form event resize
and do the following check
private void MyForm_Resize(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized) this.Hide();
else this.Show();
}
// you could also restore the window with a
// double click on the notify icon
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
this.Show();
this.WindowState = FormWindowState.Normal;
}
For a example can download this project
Don't worry about the right click event, the NotifyIcon
will automatically detect it and show the ContextMenu
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With