C
C# Learner
BringToFront() has the desired effect in my app if the notify icon's
(system tray icon's) context menu is used. However, I can't
BringToFront() in response to a Click event handler.
Here's the code:
private void showContextMenuItem_Click(object sender,
System.EventArgs e)
{
DoShow(); // BringToFront() in DoShow() will work here.
}
private void notifyIcon_Click(object sender, System.EventArgs e)
{
DoShow(); // BringToFront() in DoShow() DOES NOT work here.
}
private void DoShow()
{
Show();
if (WindowState == FormWindowState.Minimized) {
WindowState = FormWindowState.Normal;
}
BringToFront();
}
Anyone have an idea?
(system tray icon's) context menu is used. However, I can't
BringToFront() in response to a Click event handler.
Here's the code:
private void showContextMenuItem_Click(object sender,
System.EventArgs e)
{
DoShow(); // BringToFront() in DoShow() will work here.
}
private void notifyIcon_Click(object sender, System.EventArgs e)
{
DoShow(); // BringToFront() in DoShow() DOES NOT work here.
}
private void DoShow()
{
Show();
if (WindowState == FormWindowState.Minimized) {
WindowState = FormWindowState.Normal;
}
BringToFront();
}
Anyone have an idea?