我如何模仿程序托盘 [英] How can I mimize to tray for a program

查看:66
本文介绍了我如何模仿程序托盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何最小化程序到纸盘
我绝对不知道这件事:D

如果有人向我抓取代码并对其进行解释,我将非常高兴.

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

推荐答案

将窗口最小化到系统托盘 [更多 [ ^ ]
http://stackoverflow.com/questions/7625421/minimize-app-to-system-tray[^]
Minimize window to system tray[^]
more[^]


请按照以下步骤操作:-
1)首先将form的ShowInTaskbar属性设置为false,
2)在表单上添加NotifyIcon控件后,
3)现在,首先将notifyicon的icon属性设置为适当的图标,
4)之后,将其visible属性设置为false,
5)
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)
private void frmNotify_Resize(object sender, EventArgs e)
   {
            if(this.WindowState==FormWindowState.Minimized)
            {
                notifyIcon1.Visible = true;
            }
    }


6)在此之后添加一个ContextMenuStrip并创建一个用于显示的工具条,并在其click事件中写入


6) After this add a ContextMenuStrip and create a toolstrip for show and in its click event write

this.WindowState = FormWindowState.Normal;


7)现在在notifyicon的属性中,您可以找到contextmenustrip的属性,现在添加contextmenustrip的对象.
8)就这样运行代码,并将其最小化,您可以在任务栏上找到它,现在右键单击它,然后单击显示.

希望这能解决您的问题.


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.


已经尝试过了.感谢谁在寻找解决方案.
Already tried it . thanks for who was finding the solution.


这篇关于我如何模仿程序托盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆