Browse by Tags
All Tags »
Windows Forms (
RSS)
Version 1.0 of the .NET Framework introduced System.Drawing.Region 's Union method , designed to union two regions or several other types into a region. A bug, first reported in 2001, caused unexpected behavior. The method's output was determined as unreliable. Version 1.1 went past and the bug was not...
A little known, as far as I can tell from asking around, yet extremely useful property in the Windows Forms designer's property grid is GenerateMember . Defaulting to true , it decides whether a control/component gets declared as a field on the form ( true ) or as a local variable in the InitializeComponent...
A colleague was baffled by having Control.Invoke (when called from a different thread) throw an ArgumentException at him and asked if I knew what was happening. Opening the stack trace, I found that the exception originated from Control.MarshaledInvoke : at System.Windows.Forms.Control.MarshaledInvoke...
The following code illustrates a great use for anonymous methods. public class MyContainerControl : Control { private class MySpecializedControl : Control { protected virtual void OnMyEvent(EventArgs e) { if ( this .MyEvent != null ) this .MyEvent( this , e); } public event EventHandler MyEvent; } private...
Today I discovered that the Windows Forms Designer in Visual Studio 2005 doesn't know how to handle generics. For instance, the following example: private class MyControl<T> : System.Windows.Forms.Control { } could not be dropped in a Windows Forms designer (more on that in a little bit). If you...