views:

4297

answers:

9

I'm working on a solution that contains multiple projects targeting Windows Mobile 5 and standard Windows applications.

Lately when opening up a form in designer the common UI controls (textbox, button, label, etc etc...) have vanished leaving only the controls defined within the project.

Resetting the toolbox has no effect. A google search suggested deleting the toolbox temp files in the "Local Settings\Application Data\Microsoft\VisualStudio\9.0", however this was only successful in bringing back the default controls for Windows Mobile 5. The WinForms controls are still mysteriously missing.

Also, if I right-click and 'Select All' on the toolbox, all of the WinForms controls do in fact come up, however they're all grayed out.

Has anyone else experienced this?

+1  A: 

I've noticed this exact same thing for regular WinForms as well. I can't speak to mobile applications but in regular winforms this has a tendency to happen.

I believe it's actually a bug in Visual Studio.

There are some things you can do (again, for WinForms. I'm not sure about mobile) with adding attributes to your control. Such as:

[ToolboxBitmap(typeof(MyControl), "MyControlBitmap")]

There are some other useful related things on this site:

http://en.csharp-online.net/Design-Time_Integration—Attributes

justin.m.chase
A: 

Actually you may be able to add a registry key to get this to work also.

justin.m.chase
A: 

If you are running Visual Studio 2008 under vista, try running it as an Administrator. Right click on the shortcut and select Run as Administrator.

+1  A: 

I just had a similiar problem. In a managed C++ project all the default toolbox items disappeared form the winforms designer. After playing around for a while I found that there was a problem in the .vcproj file.

<VisualStudioProject
    ProjectType="Visual C++"
    Version="9,00"
    Name="COLLADA Import"
    ProjectGUID="{0DEEF9B6-1929-44E3-92EC-13712839FB63}"
    RootNamespace="COLLADAImport"
    Keyword="ManagedCProj"
    TargetFrameworkVersion="0"
    >

When you set TargetFrameworkVersion to a valid number, for example 131072 for .Net 2.0, the toolbox items will be back.

Simon H.
A: 

If you right click on the Toolbox and select 'Choose Items...' and then sort by the 'Namespace' column, you can then select the ones you need (for example System.Windows.Forms for WinForms).

You can multiselect with Shift and then select/deselect the group.

The controls then reappear in the Toolbox as enabled.

pro
A: 

well guess what install Service pack 1 for VS 2008 and it would go away and if you have wireless mouse and keyboard turn it off. choose one of these two both work...

Muneeb Fayyaz
A: 

I installed VS 2008 service pack today and it created this whole mess of my toolbox controls missing and then being greyed out when found.

Ralph
A: 

go to menu tools and choose import n export setting, then choose reset all setting, then yes,save your cureent setting after that you got your toolbox re appear

ucupahmec
A: 

a silly mistake..i was looking for a tool box in aspx.cs..actually toolbox is visible when aspx is open...LMAO!!

wizKing