H
Hector Santos
What do you see in the (main) form properties to implement a
NotifyICON so that the form does not "Flicker" on startup?
I can make it hide, but there is a flicker. Calling Hide() or setting
visible in Form1_Load() doesn't work. So I have it in Form1_Shown().
Do I have to edit the auto-generated form1.designer.cs class to set
the default visible flag to false? The property editor does not have
a Visible property. All I see is a ShowInTrayBar and I turned that
off too.
Basically I have this:
private void Form1_Load(object sender, EventArgs e)
{
Hide();
notifyIcon1.Visible = mySettings.UseSystemTray;
}
private void Form1_Shown(object sender, EventArgs e)
{
if (notifyIcon1.Visible)
{
Hide();
}
else
{
Show();
}
}
private void Form1_FormClosing(object sender,
FormClosingEventArgs e)
{
if (notifyIcon1.Visible)
{
Hide();
e.Cancel = true;
return;
}
}
//
// Notify icon Menu Item: Exit
//
private void miTrayExit_Click(object sender, EventArgs e)
{
notifyIcon1.Visible = false;
Close();
}
//
// Notify icon Menu Item: Status
//
private void miTrayStatus_Click(object sender, EventArgs e)
{
Show();
}
The question is: how to removing the flicking? Hiding on load doe not
work to disable the visibility flag by the time Form1_Shown() is
called. So it seems to be set at that point.
NotifyICON so that the form does not "Flicker" on startup?
I can make it hide, but there is a flicker. Calling Hide() or setting
visible in Form1_Load() doesn't work. So I have it in Form1_Shown().
Do I have to edit the auto-generated form1.designer.cs class to set
the default visible flag to false? The property editor does not have
a Visible property. All I see is a ShowInTrayBar and I turned that
off too.
Basically I have this:
private void Form1_Load(object sender, EventArgs e)
{
Hide();
notifyIcon1.Visible = mySettings.UseSystemTray;
}
private void Form1_Shown(object sender, EventArgs e)
{
if (notifyIcon1.Visible)
{
Hide();
}
else
{
Show();
}
}
private void Form1_FormClosing(object sender,
FormClosingEventArgs e)
{
if (notifyIcon1.Visible)
{
Hide();
e.Cancel = true;
return;
}
}
//
// Notify icon Menu Item: Exit
//
private void miTrayExit_Click(object sender, EventArgs e)
{
notifyIcon1.Visible = false;
Close();
}
//
// Notify icon Menu Item: Status
//
private void miTrayStatus_Click(object sender, EventArgs e)
{
Show();
}
The question is: how to removing the flicking? Hiding on load doe not
work to disable the visibility flag by the time Form1_Shown() is
called. So it seems to be set at that point.