NotifyIcon导致窗体在关闭时挂起 [英] NotifyIcon causing form to hang when closing

查看:80
本文介绍了NotifyIcon导致窗体在关闭时挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在主应用程序窗体的Load方法中,我有一个NotifyIcon对象,该对象被设置为图标.此图标已嵌入我的资源文件中.我遇到的问题是,当我关闭主窗体时,应用程序在消失之前会挂起3或4秒钟.我将其范围缩小到以下代码行:

In my main application form's Load method I have a NotifyIcon object that is being set to an icon. This icon is embedded within my resource file. The problem I am having is that when I'm closing the main form the application hangs for a good 3 or 4 seconds before dissapearing. I've narrowed it down to this line of code:

<身体>
notifyIcon.Icon = Properties.Resources.Dictionary2;
notifyIcon.Icon = Properties.Resources.Dictionary2; 

推荐答案

ArtVandelez,

应该说您的代码没有错误,
notifyIcon.Icon = Properties.Resources.Dictionary2;
那么,您介意提供更多示例代码或其他信息吗?谢谢!

最好的问候,
Guo
Hi ArtVandelez,

It should be to say that there is no error in your code,
notifyIcon.Icon = Properties.Resources.Dictionary2;
So, would you mind providing more sample code or other information? Thank you!

Best regards,
Guo


这篇关于NotifyIcon导致窗体在关闭时挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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