logo

 

     
 
Home
Site Map
Search
 
:: Bitwise Courses ::
 
Bitwise Dusty Archives
 
 
 

rss

 
 

ruby in steel

learn aikido in north devon

Learn Aikido in North Devon

 


Section :: Rants and Raves

- Format For Printing...

Can’t Add WPF Controls From Toolbox?

Problem and Fix For VS2008 WPF Apps
Monday 10 March 2008.
 

My attempts to design a nice shiny front end to my C# applications using Microsoft’s new WPF (the rather forgettable abbreviation of the longwinded ‘Windows Presentation Foundation’ Framework), were, initially, sorely frustrated. I fired up Visual Studio 2008, started a WPF Application and tried dropping some controls onto it - no deal!

The darn thing let me drag but it wouldn’t let me drop! I spent a happy hour trying to figure out what the heck I might be doing wrong. Was I expected to add controls in hand-crafted code, maybe? Nah, why would the Toolbox be there it that was the case? So maybe there was some obscure configuration property I had to set? Or could it be that Windows Vista was (once again) refusing to let me do some perfectly reasonable task because, for reasons of its own, it had decided I was an unfit person?

Anyway, just in case you’ve had this problem too, let me put your out of your misery. I eventually Googled down the answer in a Microsoft forum. These are the steps you have to take:

1. Exit Visual Studio
2. Navigate to your user profile directory for Visual Studio (this is found at %USERPROFILE%\AppData\Local\Microsoft\VisualStudio\9.0)
3. Delete the TBD files found there (they are often hidden files)
4. Re-start Visual Studio and open your WPF application - the toolbox should be automatically rebuilt.

This fixed the problem for me. Not sure I would have worked this out without Google’s (and Microsoft’s) help, though. OK, so now I’ve started using the WPF designer, I have to say that my initial impressions are pretty positive. All it needs now is a snappier name. The web-specific subset of the WPF is called Silverlight. When this was in beta it was known as “Windows Presentation Foundation/Everywhere” but, fortunately, someone in Microsoft had a blinding flash of sanity and came up with the new name. Bizarrely, the WPF has a nice name while in beta (‘Avalon’) but was saddled with the hideous ‘Windows Presentation Foundation’ moniker upon release.

AddThis Social Bookmark Button


Home