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

  • SEARCH
  • Home
  • 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 8153225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:56:54+00:00 2026-06-06T15:56:54+00:00

This form has a NotifyIcon object. When the user clicks on the Close button,

  • 0

This form has a NotifyIcon object. When the user clicks on the Close button, I want the form not to close but to become invisible. And then, if the user wants to see the form again, he can double click on the icon in the systray. If the user wants to close the form, he can right click on the icon and select “close”.

Can someone tell me how to make the close button not close the form but make it invisible?

(or if someone can think of a better way to achieve the same objective by all means)

  • 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-06-06T15:56:56+00:00Added an answer on June 6, 2026 at 3:56 pm

    First, you want to handle your Main form’s .FormClosing event (or by overriding the OnFormClosing method). Cancel that by setting e.Cancel to true.

    Then, you use a NotifyIcon to add an icon to the system tray.

    Finally, hide the form by calling .Hide().

    protected override void OnFormClosing(FormClosingEventArgs e) {
        if (IActuallyWantToCloseFlag)
            return;
    
        var ni = new NotifyIcon(this.components)
        {
            Icon = someIcon,
            Text = "My text",
            Visible = true
        };
        ni.DoubleClick += (sender, args) => { this.Show(); };
    
        this.Hide();
        e.Cancel = true;
    }
    

    This should get you started. You probably want to make ni a member variable, so that you can continue to hide/show the icon as you show/hide your form.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form, this form has a submit and a cancel button. when
I want use page that has this form: <form method=post action=modules.php?name=search> <input onkeypress=FKeyPress(this); onkeydown=FKeyDown(this);
Getting a rendering error for this form: 'NoneType' object has no attribute 'widget' http://dpaste.com/88585/
So this has to do with an order form. If the user does enter
This form has inputs with the same name but similar (incremental) ids. The form
I'm working on an asp.net web form. This form has a button to open
A lot of this form has specific attributes for my payment provider, but I
I have a form (Form1) and this form has a System.Timers.Timer object. I'd like
I have a form for user to input some feedbacks, and this form has
I have this form which has a section where a user can specify an

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.