如何使启动窗体最初不可见的或隐藏的窗体、最初

2023-09-02 10:40:16 作者:劳资就爱放你小白鸽

如何使启动窗体最初不可见的或隐藏的

How to make the startup form initially invisible or hidden

我有一个GUI项目2形式和形式必须被分别显示。即当表1所示,所有其他形式必须是隐藏的。

I have a GUI project with 2 form and the forms have to be displayed separately. i.e. When form 1 is shown, all the other forms must be hidden.

我可以隐藏所有其他形式的,但我不能掩饰启动form.so,在系统托盘我的应用程序的图标。

I can hide all the other forms, but I cannot hide the startup form.so that my application's icon in the System Tray.

例如,防火墙/防病毒软件和即时消息应用程序做到这一点,以便在后台运行,仍然是可访问的从系统托盘中的用户。

For example, firewall/antivirus and instant messaging applications do this so as to run in the background and still be accessible to the user from the System Tray.

推荐答案

我猜你问的是如何使窗体不会出现在任务栏中,只出现在系统托盘中,就像是一个IM或防病毒?

I'm guessing that what you're asking is how to make the form not appear in the task bar and only appear in the system tray, just like an IM or an anti virus?

如果是这样,表格 ShowInTaskbar 属性只是设置为

If so, just set the ShowInTaskbar property of the Form to false.

作为使初步形成无形的,你必须使用一个ApplicationContext在 Application.Run ,而不是主要形式。

As for making the initial form invisible, you'll have to use an ApplicationContext within Application.Run instead of the main form.