ShowInTaskbar =真使我的形式消失 [英] ShowInTaskbar=true makes my form disappear

查看:118
本文介绍了ShowInTaskbar =真使我的形式消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应用程序被编译为.NET 2.0(如果适用)。 初步形成与ShowInTaskbar创建=假的,它不会出现在任务栏上,一切都很酷。然而,当某些操作(拖动窗体上的文件和启动文件上传)确实ShowInTaskbar = TRUE(为了显示出与不断变化的窗口标题/ win7的任务栏功能的进步),则主要形式消失。 this.Show(),THIS.VISIBLE =真正的 - 他们不帮助。形式是无处可寻,直到ShowInTaskbar =假执行。然后,它会出现在同一个地方在那里失踪...任何想法可能是这样吗?

App is compiled for .NET 2.0 (if its relevant). Initially form is created with ShowInTaskbar=false, it does not appear in taskbar and everything is cool. However when certain action (dragging file on the form and starting file upload) does ShowInTaskbar=true (in order to show progress with changing window title/win7 taskbar functionality) then main form disappears. this.Show(), this.Visible=true - they dont help. Form is nowhere to be found until ShowInTaskbar=false is executed. Then it appears in same spot where it went missing... Any ideas what could be happening?

推荐答案

我知道这个问题已经被问了一年前,但它仍然弹出不时在谷歌搜索结果中。

I know this question has been asked over a year ago but it still pops up from time to time in google search results.

如前所述,当设置ShowInTaskbar窗户再现了整个窗体(或类似的东西)。所以,如果你有输入字段或控件,如他们将被重置。

As stated when setting ShowInTaskbar windows recreates the entire form (or something like that ). So, if you have input fields or any controls like that they will be reset.

在我的情况,我用ShowInTaskbar =假的时,我希望尽量减少我的应用程序的通知托盘区,让我的应用程序最小化时不再出现在任务栏中。问题来了,当你恢复应用程序FormWindowState.Normal所有你previously有复位控制。

In my case, I used ShowInTaskbar = false when I want to minimize my application to the notification tray area, so that my app no longer appears in the taskbar when minimized. The problem comes when you restore the application to FormWindowState.Normal all the controls that you previously had are reset.

解决方法是删除从表单的所有控件this.Controls.Remove(控制1),呼吁ShowInTaskbar =假前,然后重新添加this.Controls.Add(控制1)他们曾经的形式是恢复。

The work around is to remove all the controls "this.Controls.Remove(control1)" from the form before calling ShowInTaskbar = false and then re-add "this.Controls.Add(control1)" them once the form is restored.

这是在我的工作。 希望它可以帮助你和其他人。

That's my work around. Hope it helps you and others.

这篇关于ShowInTaskbar =真使我的形式消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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