How Windows Form Invisible

  • Thread starter Thread starter Jawad Rehman
  • Start date Start date
J

Jawad Rehman

Hello EveryBody....

I want to hide Window Form in C#.net.e.g
I have an application in which there is one form only,when the
application runs,no form will display,but application runs.
Just like Vb6, when we write the statement
"Me.hide"
 
Jawad,

ShowWindow is your friend... use this code:


[System.Runtime.InteropServices.DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);


private void button1_Click(object sender, EventArgs e)
{
ShowInTaskbar = false;

//Hide
ShowWindow(this.Handle, 0);

//Show
//ShowWindow(this.Handle, 1);
}


Best Regards
Marcel
 
Jawad Rehman said:
Hello EveryBody....

I want to hide Window Form in C#.net.e.g
I have an application in which there is one form only,when the
application runs,no form will display,but application runs.
Just like Vb6, when we write the statement
"Me.hide"

Have you tried this.visible = false; ?
 
All of the above mentioned work.. Just as FYI for you!!

The "Me" equivalent in C-Sharp is "this", so this.Hide() will work also.

VJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top