문제

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?

도움이 되었습니까?

해결책

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;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top