Click here to Skip to main content
15,561,958 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
C#
this.visble=false;
it didn't work.

I then tried
C#
this.Hide();


It hides my required from but when I open that EXE it blinks once then it hides.

I also tried
C#
this.Visible = false;
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = false;

How to permanently hide without showing even a blinking in the screen
Posted
Updated 1-Oct-22 23:37pm

have you tried Opacity property ?

C++
void Form1_Load(object sender, EventArgs e)
  {
     this.Opacity = 0.0;
  }
 
Share this answer
 
v2
C#
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);
 }
 
Share this answer
 
Comments
KUMAR619 5-Sep-14 2:33am    
Your are a good thinker
Gihan Liyanage 5-Sep-14 2:50am    
Hah Hah... Tahanx ...
C#
public Form1()
{
	InitializeComponent();
	FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
	ShowInTaskbar = false;
	Opacity = 0;
	Size = new Size(0, 0);
}

// hiding from Alt+TAB dialog
protected override CreateParams CreateParams
{
	get
	{
		CreateParams cp = base.CreateParams;
		cp.ExStyle |= 0x80;
		return cp;
	}
}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900