In my windows application which uses menu strip and multiple panel containers, a panel is displayed depending on menu option
hiding all panels by manually passing names is very time consuming, is there any way to hide all panels or any way to get names of all panels in a form??
if by Blue Border thats on top of the Window Form you mean titlebar, set Forms ControlBox property to false and Text property to empty string ("").
The easiest way to go full screen in an application or a game is to use the Alt + Enter keyboard shortcut. This method works for most games and apps unless they use it to enable other features. The shortcut is also used to switch from full-screen mode to windowed.
foreach (Control c in this.Controls)
{
if (c is Panel) c.Visible = false;
}
And you could even make that recursive, and pass in the ControlCollection
instead of using this.Controls
:
HidePanels(this.Controls);
...
private void HidePanels(ControlCollection controls)
{
foreach (Control c in controls)
{
if (c is Panel)
{
c.Visible = false;
}
// hide any panels this control may have
HidePanels(c.Controls);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With