Archive | Windows Forms RSS for this section

UI automation with the White framework and UISpy tool

This weekend I posted a new article which covers the most important features of the open-source White framework and the Microsoft UISpy tool. White can be used for UI automation and my C# .NET application demonstrates how to automate the Windows calculator by sending keystrokes, clicking on buttons and menus, pressing function keys, accessing textboxes, …

The whole article can be found on

Background color problem with WinForms and WPF interoperability

Some days ago I was examining the interoperability between Windows Forms and Windows Presentation Foundation (WPF). It seems to be quite easy to integrate WPF user controls in a WinForms form by creating an ElementHost (System.Windows.Forms.Integration) object. I really like this component because it makes it possible to integrate some powerful graphical features of WPF in current WinForms applications.

While trying several features I bumped into an annoying background color problem. It turns out that the background of the WPF user control becomes black when I try to create all objects in run-time and use SystemColors.Control as background color.

So this small article on my website provides a workaround to solve the background color problem of the ElementHost class. It also demonstrates how you can map properties between Windows Forms controls and WPF UI elements.