Hi,
I used the code in this http://www.developer.com/net/csharp/article.php/3336751 link. It works but when I open abother form on my main form the number of icons appearing increase. In the program the user needs to open those forms and that becomes messy since the user sees more than 10 icons. How can I prevent those extra icons from appearing when another form is opened on the main form.
Loading
ozzyPosted Jul 30, 2007, 3:52 AM
I tried to use a global variable to control these two functions that I created but I realized that none of these functions create the icon, because the first one is used to hide the program from the taskbar and the second is used to show the program when the icon is clicked. But I don't know what is it that creates that icon therefore I can't control that process. Anyone know what to do?
void Form1_Resize(object sender, EventArgs e)private
{
if (WindowState == FormWindowState.Minimized)
Hide();
}
private void notifyIcon1_DoubleClick(object sender, EventArgs e){
Show();
WindowState = FormWindowState.Normal;
}
Don FeistPosted Jul 27, 2007, 12:18 PM
NathanPosted Jul 25, 2007, 8:55 PM
I'm pretty new to C# so im not sure, but you could probably make a global var to set to true when yoru first form opens. Then in your initializeComponent method you can do an if statement to check if your var is true... if it isnt, create the icon.. if it is... skip that bit :)