Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6037353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:03:38+00:00 2026-05-23T06:03:38+00:00

Okay firstly I just started C# so I’m not exactly the most skilled programmer

  • 0

Okay firstly I just started C# so I’m not exactly the most skilled programmer out there. Okay so here’s my problem that may seem stupid to you guys 😉

I have a simple enough app that a friend asked me to do. So far I have managed with a bit of Google but I’m stuck with this. The app runs fine and minimizes to the system tray and maximizes from the system tray which is good. However, when I open a second form from that application it creates another icon in the system tray and starts duplicating every time I open another form. So eventually I have lots of icons and all of them are seperate instances of the main form. System Tray events

private void notifyIcon_systemTray_MouseDoubleClick(object sender, MouseEventArgs e)
{
    if (FormWindowState.Minimized == WindowState)
    {
        Show();
        WindowState = FormWindowState.Normal;
    }
}
private void CronNecessityForm_Resize(object sender, EventArgs e)
{
    notifyIcon_systemTray.Visible = true;
    if (FormWindowState.Minimized == WindowState)
        Hide();

}
private void restoreContextMenuItem_Click(object sender, EventArgs e)
{
    Show();
    WindowState = FormWindowState.Normal;
}

To open the Form:

private void preferencesToolStripMenuItem_Click(object sender, EventArgs e)
{
    CronPreferences.formPreferences CronPreferences = new CronPreferences.formPreferences();
    CronPreferences.Show();
}

Close it:

private void button2_Click(object sender, EventArgs e)
{
     this.Hide();
}

How can I have all Forms map to the same icon in the System Tray?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:03:39+00:00Added an answer on May 23, 2026 at 6:03 am

    You will need a single global tray icon that they all access. Do this by using a static variable that stays the same throughout different instances of the class.

    Then, if you want to:

    • Open one form: keep a reference to the latest form in a variable and open it.
    • Open all minimised forms: iterate through each form and open them again.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, here's the scenario. I have a utility that processes tons of records, and
Okay, not sure what I'm doing here, other than it's not right. Trying to
Okay i have this problem with every page i make. im not sure what
Okay. I know this looks like the typical Why didn't he just Google it
Okay, we know that the following two lines are equivalent - (0 == i)
Okay, I'm having some serious issues here. I'm new to this site, and new
Okay i know i have to use the JDBC etc, but im not sure
Okay, I'm reading about Linux kernel development and there are some code snippets using
Okay so what I have is a table that keeps track of history on
Okay, This is just for interest's sake: If for some reason, I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.