Domanda

I noticed that BorderStlye has an explicit None for "Do not show a Border" and a NotSet, which causes the control to revert to its default or CSS style.

I'd like to set the height of a panel to 0 in some cases, but then be able to return it to whatever height is designated in the style sheet, similar to what can be done with BorderStyle. Can this be done?

È stato utile?

Soluzione

You can use Unit.Empty:

myPanel.Height = Unit.Empty;

This will reset the implicit value you set before.

But if you want to hide a Control, there are better ways than setting the height to 0.

myPanel.Visible = false;
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top