how to make form disapper not close ( like msn messenger)

csharp Mexico
  • 12 years ago

     Hi there. i am new to C# programming. I am developing an updater that would update our product. I want to program the close button so if clicked the application should not close but rather hide. I have a notification icon from where the user can call it back. I want it just like in msn messenger.

  • 12 years ago

    Salam Umair Habib Peracha,

    => When you want to hide your Form, use :

    this.Hide();

    for example, in a form's button event. Then when you want to show that again, use :

    this.Show();

    for example, in double click event of your notify icon.

    - 'this' in above codes, is reference to your Form.

  • 12 years ago

     Thanks alot bro. But i have figured it out. I wanted to hide form when the user presses the close button. and close the application by right clicking on notification icon. just like the MSN Messenger. Any ways I have found out a way.

    this is the code snippet:

    on form_closing event

    e.cancel;

    this.hide;

  • 12 years ago

    Oh yes! that's that! happy to see your problem solved Smiley Face , I'm really never used MSN messenger, merely yahoo messenger Big Smile .

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.” - Donald Knuth