简体   繁体   中英

How to minimize c# program to icon tray

sorry for the short question, I just don't know even how to ask google this question. (maybe because of my bad English)

this is example picture what I want to do, I want my software to be like all the icons there...

这是我想做的示例图片,我希望我的软件像那里的所有图标一样...。

Thanks a lot

You'll have to use the NotifyIcon Component .

Example:

var ni = new NotifyIcon()
ni .Icon = new System.Drawing.Icon("yourIcon.ico");
ni .Text = "My applicaiton";
ni.Visible = false;

And then when you click close/hide:

ni.Visible = true;
Hide()

More informations here: http://www.c-sharpcorner.com/UploadFile/deepak.sharma00/how-to-show-notifyicon-in-windows-forms-application-using-C-Sharp/

Use a NotifyIcon

Icons in the notification area are shortcuts to processes that are running in the background of a computer, such as a virus protection program or a volume control. These processes do not come with their own user interfaces. The NotifyIcon class provides a way to program in this functionality. The Icon property defines the icon that appears in the notification area. Pop-up menus for an icon are addressed with the ContextMenu property. The Text property assigns ToolTip text. In order for the icon to show up in the notification area, the Visible property must be set to true.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM