3
For my application I’m developing I’m creating a icon which will be on the taskbar to show the notifications to the user and within it the user will have options such as : Quit, Open, Configure and so on, but I have no idea how to do this.
I managed to create the icon that will be next to the icons for example sound and wi-fi, but when minimizing the program it disappears from the taskbar and only gets the icon.
My code :
private void FrmIntegracaoPrincipal_Load(object sender, EventArgs e)
{
/* Minimizando aplicação na bandeja do windows */
this.Visible = false;
this.ShowInTaskbar = false;
this.WindowState = FormWindowState.Minimized;
notifyIcon1.Visible = true;
}
private void notifyIcon1_Click(object sender, EventArgs e)
{
/* Exibindo novamente o programa */
this.Visible = true;
this.WindowState = FormWindowState.Normal;
this.ShowInTaskbar = true;
notifyIcon1.Visible = false;
}
private void Form1_Resize(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.Visible = false;
this.ShowInTaskbar = false;
this.WindowState = FormWindowState.Minimized;
notifyIcon1.Visible = true;
}
//Verificando se WindowsState == Minimized
if (this.WindowState == FormWindowState.Minimized)
{
//CODIGO
}
}
How can I do this ? If anyone can help me I’d appreciate it.
It worked, thank you very much, I already gave +1 and also as a response that helped in my problem.
– Falion
But how could it cause when there is an update or changes in the application settings,?
– Falion
@Falion here you can implement using Notifyicon itself, if you want something more customized has this library that can help you.
– gato
I tested and it didn’t work,it doesn’t appear the way I want,appearing the message with a balloon coming out of the icon,it appears the message if you put the cursor over the icon.
– Falion
The lib I posted there, she’s the one you tested?
– gato
I tested another similar code and it worked normally, thank you :)
– Falion