How to make a Windows Forms .NET application display as tray icon?

前端 未结 6 2006
孤城傲影
孤城傲影 2020-12-03 07:44

What needs to be done to have your .NET application show up in Window\'s system tray as icon?

And how do you handle mousebutton clicks on said icon?

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-03 07:53

    You can add the NotifyIcon component from the toolbox onto your main form.

    This has events such as MouseDoubleClick that you can use to handle various events.

    Edit: You have to make sure that you set the Icon property to a valid .ico file if you want it to show up properly in the systray.

提交回复
热议问题