display in System tray when minimize

  • Thread starter Thread starter Grey
  • Start date Start date
G

Grey

how to set the application at the bottom right hand-side corner when I minimize the applicaiton with C#??
 
To make the functionality occur when the form is minimized, use the form's "Resized" event and check the "WindowState" property to see if it is minimized. If so, show the "NotifyIcon" that Ravichandran mentioed and set the form's "Visible" property to false.

- Noah Coad -
Microsoft MVP
how to set the application at the bottom right hand-side corner when I minimize the applicaiton with C#??
 
1. Add a NotifyIon control to the for
2. Change NotifyIon control - Icon and Text propert
3. Add following code

private void Form1_Load(object sender, System.EventArgs e

this.Visible = false


private void notifyIcon1_DoubleClick(object sender, System.EventArgs e

this.Visible = true
// Set the WindowState to normal if the form is minimized
if (this.WindowState == FormWindowState.Minimized
this.WindowState = FormWindowState.Normal

// Activate the form
this.Activate()


private void Form1_Deactivate(object sender, System.EventArgs e

this.Visible = false
this.WindowState = FormWindowState.Minimized


Double click on System tray icon will display the form.
 
Back
Top