FAQ: Why do my forms in my managed add-in or VSTO 2003 look Windows 95-ish

This is a frequent question that comes up. You develop a managed add-in or VSTO 2003 code behind. You show a windows form and yuck--it looks like Windows XP never happened. The buttons aren't pretty like the Windows XP buttons. Everything looks circa Windows 95.

The trick is you have to tell Windows Forms to use the Windows XP theming by writing this line of code somewhere in your application before you start creating and showing forms:

System.Windows.Forms.Application.EnableVisualStyles();

That's it! Prettiness restored.