Click here to Skip to main content
15,878,871 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hey

How can I minimize program to tray
I absolutely have no knowledge in this :D

I will be gladful if someone grab the code to me with an explain to it
Posted

Follow the steps:-
1) First set the ShowInTaskbar property of form to false,
2) After add NotifyIcon control on the form,
3) Now first set the icon property of notifyicon to a proper icon,
4) After that set its visible property to false,
5)
C#
private void frmNotify_Resize(object sender, EventArgs e)
   {
            if(this.WindowState==FormWindowState.Minimized)
            {
                notifyIcon1.Visible = true;
            }
    }

6) After this add a ContextMenuStrip and create a toolstrip for show and in its click event write
C#
this.WindowState = FormWindowState.Normal;

7) Now in property of notifyicon you can find a property for contextmenustrip now add the object of contextmenustrip.
8) That's it run you're code and minimize it you can find it on your task bar now right click it and click on show.

Hope this will solve your problem.
 
Share this answer
 
Already tried it . thanks for who was finding the solution.
 
Share this answer
 
Comments
bbirajdar 23-Nov-12 12:47pm    
If you have already tried something then you should mention it in your question so that we will not waste our precious time in posting the same solutions again
Nelek 23-Nov-12 15:26pm    
Please don't post solutions to add information, to ask something or to comment another user.
- To add information to your message, you can use the widget "Improve question" / "Improve solution" at the bottom of your text.
- To ask/answer a user, you can use the widget "Have a question or comment?" (as I am doing right now with you) or the widget "reply" in another comment.
hari19113 25-Nov-12 12:00pm    
After trying it did you succeed?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900