form hide (or visible = false)

O

Ohad Young

Hi,

In the form's Load event handler I'm trying to hide the form, but still the
form is visible although the Visible property is set to false.
Only if the ShowInTaskBar property is set to false too, it is not visible.
Why?
Isn't there a way to hide a form from its Load event handler but to display
it still in the task bar?

Here is the code:
// handler for the Load event

private void FrmLifetimeDemo_Load(object sender, System.EventArgs e)

{

this.Visible = false;

this.ShowInTaskbar = false;

}


--
Ohad Young
Medical Informatics Research Center
Ben Gurion University
Information System Eng
Office Phone: 972-8-6477160
Cellular Phone: 972-54-518301
E-Mail: (e-mail address removed)
 
C

Claudio Grazioli

Hi,

In the form's Load event handler I'm trying to hide the form, but still the
form is visible although the Visible property is set to false.
Only if the ShowInTaskBar property is set to false too, it is not visible.
Why?
Isn't there a way to hide a form from its Load event handler but to display
it still in the task bar?

Here is the code:
// handler for the Load event

private void FrmLifetimeDemo_Load(object sender, System.EventArgs e)

{

this.Visible = false;

this.ShowInTaskbar = false;

}

What exactly do you want to do? If your form is not visible but is still
visible in the taskbar, what should happen, if the user clicks on it in the
taskbar? Should the form then get visible? or what?

So isn't it enough, if you just minimize your form?
like aForm.WindowsState = FormWindowState.Minimized;
 
H

Herfried K. Wagner [MVP]

Ohad Young said:
In the form's Load event handler I'm trying to hide the form, but still
the form is visible although the Visible property is set to false.
Only if the ShowInTaskBar property is set to false too, it is not visible.
Why?
Isn't there a way to hide a form from its Load event handler but to
display it still in the task bar?

Set its 'WindowState' property to 'Minimized'.
 
O

Ohad Young

Hi,

Thanks for the reply.
What I want is to understand why only setting both properties, Visible and
ShowInTaskBar, to false will hide it if written in the Load event handler of
the form.

Ohad
 

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


Top