如何使用Windows Forms C#创建不可见的表单 [英] How to create an invisible Form using Windows Forms C#
本文介绍了如何使用Windows Forms C#创建不可见的表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这可能是一个愚蠢的问题,但我无法做到。
打开EXE时我打开两个表格。
我需要让一张表格永远隐形。
我尝试过
This may be a silly question but I am unable to do it.
I am opening two forms when opening an EXE.
I need to make one form always invisible.
I tried
this.visble=false;
它没用。
然后我尝试了
it didn't work.
I then tried
this.Hide();
它隐藏了我的要求,但是当我打开EXE时它会闪烁一次然后隐藏。
我也试过
It hides my required from but when I open that EXE it blinks once then it hides.
I also tried
this.Visible = false;
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = false;
如何永久隐藏而不显示屏幕上的闪烁
How to permanently hide without showing even a blinking in the screen
推荐答案
有你试过Opacity属性?
have you tried Opacity property ?
void Form1_Load(object sender, EventArgs e)
{
this.Opacity = 0.0;
}
public Form1()
{
InitializeComponent();
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.ShowInTaskbar = false;
this.Load += new EventHandler(Form1_Load);
}
void Form1_Load(object sender, EventArgs e)
{
this.Size = new Size(0, 0);
}
这篇关于如何使用Windows Forms C#创建不可见的表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文