I am writting an application that uses NotifyIcon in C#. I want when user clicks on the NotifyIcon on the system tray (bottom-right of the screen) a notification form (this is not the mainform, it's only a minor form that is used to show notification) will show up at the location of NotifyIcon as Dropbox do:
I have used the event MouseClick of NotifyIcon and wrote as follows:
private void NotifyIcon_MouseClick(object sender, MouseEventArgs e)
{
Form2 form = new Form2();
form.SetDesktopLocation(MousePosition.X - form.Width/2,MousePosition.Y-form.Height-20);
form.Show();
form.Focus();
}
but it does not work as expected, the notification form show up at the location of main form not at the location of NotifyIcon.
can anybody can help me:|