Monthly Archives: November 2011

Useful EventArgs utility class

Although there is a generic version for EventHandler delegate available in .NET Framework: EventHandler<TEventArgs>, it requires that generic argument derives from EventArgs. For very simplistic scenarios where you want to send simple data such as string or a number, creating a new class for the event argument is little too much work. Read the rest of this entry

Windows Forms AutoSize usage (.NET bug included)

Although development of Windows Forms stopped two .NET versions ago and was pretty much replaced by WPF, there are still legacy .NET applications around based on Windows Forms. Since mixing WPF and Forms is generally a bad idea, this small article aims to show that dynamic and flexible layouts are still possible and in fact easily achieved in Windows Forms. I will also show you that there are certain hoops that need to be jumped over like .NET bugs.
Read the rest of this entry

Application.DoEvents are evil

It is no small wonder that the MSDN reference page for the Application.DoEvents method comes with a (somewhat dire) warning:
Read the rest of this entry