Difference in Control.Visible property behavior between .NET Compact Framework and the Full .NET Framework

You Can Take it With You

Syndication

News

  • Don't miss the next Windows Mobile Webcast... Unit Testing for Mobile Devices: http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032382824&EventCategory=4&culture=en-US&CountryCode=US.

I just came across this issue while researching some form behavior issues.

When you test the value of the Control.Visible property a return value of True indicates...

  • In the Full .NET Framework, true indicates that the Visible property has been set to true.
  • In the .NET Compact Framework, true indicates that the control is actually visible.

The one place where this difference matters is in the Load event handler. If a control has its Visible property set to true when the Load event fires, the Full .NET Framework returns true whereas the .NET Compact Framework returns false.

The difference is that .NET Compact Framework looks at the native value for whether the control is actually visible; the Full .NET Framework tracks the property value in managed code.

For more information checkout When the Form.Load event is fired, the form Visible property is still false.


Posted Jun 19 2007, 12:37 PM by jim-wilson

Add a Comment

(required)  
(optional)
(required)  
Remember Me?