Starting up the win form as non visible

M

melon

So I have something like

Application.Run(new PopupForm());

public PopupForm()
{
InitializeComponent();
}

I want the PopupForm as non visible from anywhere (including the
actual form should be non visible, as well as in task bar, alt tab
bar). I tried to add this.Visible = false, or this.Hide() in the
constructor of PopupForm but none of them works.... the form still
shows up all the time. Is there anything I have done wrong?

I also tried to start it up as Minimized, but then it is still visible
in the alt tab bar.
 
B

Bryan Phillips

If you don't want the form to be displayed until you need it, use a
console application instead and close the handle to the console to hide
it. Then, instantiate your form when you need to show it.

One question though: If you succeed in hiding the form, how do close
your application?
 
B

Brian Schwartz

Bryan asks a good question.

Assuming that's taken care of, another possibility is setting ShowInTaskbar
to false and Opacity to 0%.
 

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

Top