Critical Development

Language design, framework development, UI design, robotics and more.

.NET Custom Control Resources

This is a growing set of resources for developers of custom controls, and will be initially focused on Windows Forms controls (for both regular .NET and Compact Framework), although at some point in the future, I will start including resources for WPF, Silverlight, and potentially also web controls.

Custom control development is a difficult and often frustrating endeavor, one that I’ve struggled with for the past couple of years.  I’ve written a few articles on the subject on my own blog, and in addition to writing more articles there, I also want to draw your attention to other good resources I’ve found on the Internet in MSDN articles, documentation, and various blogs, as well as in a small collection of books that touch on the subject.

Normally I add links to resources in my blog articles for further study, and though I will continue to do so, I believe it will be helpful to start organizing these resources in a single place.  If you know of any resources that could help clear the fog of confusion for aspiring control designers or elucidate the sparsely-documented details of Visual Studio extensibility surrounding custom designers, type converters, and the like, please leave a comment and I will add them to the list.

While it’s always nice to see working examples of custom controls and designers, I am especially on the lookout for information on pitfalls encountered along the path to making those solutions work.  Seeing a goal achieved is great, but knowing how to work through problems on the way to your destination can be even more valuable.  As I once heard a doctor say, “I could teach you how to perform an appendectomy in about 45 minutes, it’s really not hard; but it would take many years to teach you what to do in case something went wrong.”

As an example, I renamed one of my custom controls, and suddenly the forms on which I had put instances of this control wouldn’t display in the designer, and instead I got error messages telling me that specific properties weren’t available on UnsafeControl.  The answer was that I had forgotten to update my .xtma file–the design-time attributes file used for Compact Framework doesn’t get included in the Rename refactoring, and without the DesktopCompatible=true setting, it determined that my control was unsafe and thus gave the error.  This is a simple example, and many are much more complicated, so it’s important to create an awareness of the many tricky issues that may come up that are unique to custom control development, in the same way that we train ourselves to recognize exception messages and relate them to their common causes.

My Articles

Blogs & Other Articles

There are a handful of kind folks out there who have shared their experiences and knowledge of several custom control topics.  Sometimes it’s these blog articles that provide the most approachable view of the subject.


There are a few websites devoted to building .NET user interfaces, custom controls, Windows Forms, WPF, etc.

Microsoft Connect Suggestions & Bug Reports

There are some things that, if added to Visual Studio or the .NET Framework, would simplify or otherwise enhance the custom control-writing experience; and there are bugs that, if fixed, would do the same.  Here are some that I’ve either discovered on Microsoft’s Connect (feedback) site, or have submitted myself.

  • 339898 – Provide validation of .xtma file contents for Compact Framework custom control projects.
  • 339896 – Update .xtma file contents when a Rename refactoring is executed on control class or class member names (properties, events, etc.)

I have many more links and resources, so please bear with me as I update this page.  I’ll be reading through the Microsoft Connect suggestions and bug reports to find the custom control and designer gems, and will continue in my research of blog articles and other websites, as well as podcasts and other media formats.

2 Responses to “.NET Custom Control Resources”

  1. hello i am trying to get my new phidgets to work together. i am trying to get the encoder board and the servo motor control board and the interface board to work together like a cnc. i need to be able to display the information from the encoder and drive the motor via the driver board to a set value dwell if needed and return. i wil be using a full pc running windows xp pro. is their anything i can use to get all of these to run together? or do i need to forget the phidgets all together? thanks


    • Dan Vanderboom said

      I haven’t had any problems using multiple Phidgets components. In some cases I have to plug in several USB controllers, and it seems to work. Check the Phidgets system tray app that comes with the SDK. This will tell you if it recognizes the individual components, and will let you read and set values to test them out. If that doesn’t work, you know your code isn’t the problem, and perhaps you have a defective unit.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: