Monday, January 30, 2006

Don't use Visible property to store any state for a control

For .NET (1.1, 2.0) controls, do not use the property “Visible” to store any information. If the parent control’s Visible is set to false, you won’t be able to set the subControls’ visibility to true. And there will be no exception thrown out. The system just ignores your
<code>MyControl.Visible = true;</code> if any of the parent or parent of parent control’s Visibility is false.