Control.Hide(), How to query for hidden.

  • Thread starter Thread starter Jesper, Denmark
  • Start date Start date
J

Jesper, Denmark

Hi,

How can I query a Windows.Form control if it is hidden or not.

I would like to toogle Hide/Show and not use a bool as control variable for
this but simply query the form werther or not its hidden.

regards than thanks
Jesper.
 
How can I query a Windows.Form control if it is hidden or not.

The Visible property of the control.

Two places to look for this information in the future:

1) MSDN:

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.hide.aspx

"Hiding the control is equivalent to setting the Visible property to
false. After the Hide method is called, the Visible property returns a
value of false until the Show method is called."

2) If MSDN doesn't have the information you need, try Reflector:

http://www.aisto.com/roeder/dotnet/

....which will give you this as the reflected method body of Hide()

public void Hide()
{
this.Visible = false;
}
 
Hi,

How can I query a Windows.Form control if it is hidden or not.

I would like to toogle Hide/Show and not use a bool as control variable for
this but simply query the form werther or not its hidden.

regards than thanks
Jesper.

Hi,

How do you set it as Visible or Hidden in the first place?
answer:
The only way is setting Visible to true/false
so you have to check the value of this property
 

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

Back
Top