通知图标并最小化隐藏/显示问题 [英] Notify Icon and Minimise Hide/Show Problems

查看:86
本文介绍了通知图标并最小化隐藏/显示问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个代码,当我最小化应用程序应该从任务栏消失,只有在托盘中可见,当我双击托盘图标时,它显示最大化应用程序。但是这两个函数都没有工作,我可以在托盘中显示通知图标,这就是它!??

展开 | 选择 | Wrap | 行号

解决方案

您要做的就是更改任务栏属性中的show。你不应该改变它。


使用.Visible属性。

展开 | 选择 | Wrap | 行号


要停止表单关闭,请在表单的'FormClosing事件中捕获它...

展开 | 选择 | Wrap | 行号


到第二个问题:


您将需要处理FormClosing事件。使用条件来确定是否要关闭表单。如果你这样做,什么也不做。否则,将e.Cancel更改为true。


这是一个FormClosing事件处理程序的示例

展开 | 选择 | Wrap | 行号

I have this code and when i minimise the application should disappear from the taskbar and only be visible in the tray and when i double click on the tray icon it show maximise the app. but neither functions are working, i can display the notifyicon in the tray fine, thats it!??

Expand|Select|Wrap|Line Numbers

解决方案

All you are doing is changing the show in taskbar property. You shouldn''t have to change that at all.

Use the .Visible property instead.

Expand|Select|Wrap|Line Numbers


To stop the form closing you catch it in the form''s FormClosing event...

Expand|Select|Wrap|Line Numbers


To your second question:

You will need to handle the FormClosing Event. Use conditions to determine whether you want to close the form or not. If you do, do nothing. Otherwise, change e.Cancel to true.

Here''s an example of a FormClosing event handler

Expand|Select|Wrap|Line Numbers


这篇关于通知图标并最小化隐藏/显示问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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