表单被最小化为一个图标-并通过悬停消失! ! [英] Form is minimized to an icon - and disappear by hover ! !

查看:106
本文介绍了表单被最小化为一个图标-并通过悬停消失! !的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我希望有人能够解决我的问题...
我开发winForm应用程序,
最小化时-应该显示为图标而不是任务栏.我的代码:

Hi I hope someone will be able to solve my problem...
I develop winForm application,
when it being minimized - it''s supposed to appear as an icon instead of taskbar. My code:

private void BaseForm_SizeChanged(object sender, EventArgs e)
        {
            notifyIcon1.BalloonTipTitle = "Our Program";
            notifyIcon1.BalloonTipText = "still working... ";

            if (FormWindowState.Minimized == this.WindowState)
            {
                notifyIcon1.Visible = true;
                this.ShowInTaskbar = false;
                notifyIcon1.ShowBalloonTip(500);
            }
            else if (FormWindowState.Normal == this.WindowState)
            {
                notifyIcon1.Visible = false;
            }
        }





private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            notifyIcon1.Visible = false;
            this.WindowState = FormWindowState.Normal;
            this.Show();
            Login loginFrm = new Login();
            loginFrm.ShowDialog();

        }



现在发生了一些奇怪的事情:正在按要求将程序最小化,
但是当我想双击图标时-它消失了!
意思是:当我的鼠标箭头悬停在图标上时(没有任何点击!)-图标消失了,并且
再也不会回来了,所以我必须从头开始运行该应用程序.
我只想提2条笔记:
1.我已检查-没有任何悬停事件处于活动状态.
2.我已经在单独的项目中检查了代码,这很好.

有人可以告诉我怎么回事吗?那我该怎么办?

我会请你帮忙.
Tali.



Now something strange happends: the program is being minimized as requested,
but when I want to double-click the icon - it disappears !!
Means: When my mouse arrow hover on the icon (without any click!) - the icon is gone and
never come back, so that I have to run the application from the begining.
I''ll just mention 2 notes:
1. I''ve checked - there''s no any Hover Event active.
2. I''ve checked the code in separate project and it was fine.

Can someone tell me what''s going on? And what can I do?

I''ll appriciate your help.
Tali.

推荐答案

签入TaskManager并确保您的应用仍在运行,然后再启动另一个.

确定应用程序是否仍在运行后,便可以尝试找出发生了什么.
Check in TaskManager and make sure your app is still running before you launch another one.

Once you determine if the app is still running or not, then you can proceded with trying to figure out what happened.


这篇关于表单被最小化为一个图标-并通过悬停消失! !的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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