Why is my WPF Events Tab gone? - wpf

I cannot see it any more in Visual Studio 2010. How can I do to get it back?
I have no addins as I just installed VS Studio.
Nevertheless this occurs on an existing solution with many projects inside. When I create a new WPF project from scratch the tab reappears.

It sounds like a piece of UI is missing from your Visual Studio display. Try the following to get it to show back up in it's original location
Tools -> Import / Export Settings
Select "Reset all settings" and hit Next
Save your current settings if you desire and hit Next
Pick the profile of your choice and hit "Finish"

Possible ways to fix:
Try remove all add-ins and
extensions.
Tools -> Import And Export Setting
-> Reset all settings
Repair Visual Studio installation.
It's not possible to give exact solution with such description of problem.

Your User Options file is broken.
To fix it, do the following:
Close Visual Studio
Go to the folder in which your .sln file reside
Delete the User Options file
Open the solution again
The Events tab is back!

Are you talking about the Properties Window? If the Properties Window is displayed, click on the yellow lightning bolt button towards the top. That will show you the events for the currently selected WPF element. If the Properties Window isn't open, press F4.

This is not a bug, but rather where the focus is set in your visual studio instance design view. From the design view click the window and then do properties (F4). This will enable the events to show and be set from the properties tag. Just make sure the focus is set on the proper item from which you want to set the events (dropdownlist, window, ect.). Hope this helps.

I clicked on the "Design" tab in the bottom and the "Lightning bolt" (Event tabs) reappeared, then it was still available after going into "Source" view mode.
Hope this helps someone.

Related

How do I open a WPF menu at design-time?

I'm styling a menu in WPF and would like to see how it looks, without having to launch the application to open the menu.
Is there a way to keep the menu open (so I can see the menu items) at design-time, so I can see the changes as I go?
I currently only have Visual Studio 2010 to work with.
You can set IsSubmenuOpen="True", but if you click somewhere else, menu will close. Set it again to open.
You should be able to see changes in the design window as soon as you make changes - are you using VS2010 express? I found that in express the designer didn't refresh when I made style changes - I had to close/re-open the form to see the changes reflected. You shouldn't need to build to see design changes unless of course you are adding new user controls etc that need to be built before the designer can process them

How to undo a "Reset Toolbox" in VS2008?

Is there any way to "un-Reset" the Toolbox in Visual Studio 2008?
I was trying to get my first-ever WPF UserControl to appear in the Toolbox. I rebuilt my project, then right-clicked on the Toolbox and chose "Reset Toolbox" from the pop-up menu; hoping that would "refresh" the control list (I know better now). Alas, the reset removed ALL the controls from the Toolbox for WPF projects (It's still OK for Win-Forms projects).
So is there a relatively quick way to restore all "the standard WPF controls" to the Toolbox?... I only had the standard controls (being a WPF noob) so "No" I didn't take a backup before I hit the reset switch... BIG Sigh!
Thanking you all in advance,
Keith.
EDIT: To document my (sort of) resolution to the problem...
I got my WPF controls back, but they're not in there nice seperate toolboxes (i.e. the expandable sections, or whatever you call them). Meh! It'll have to do ;-)
To get them back... With a WPF Window open (Window1.xaml for example): right-click on the General "toolbox", select "Choose items ..." from the pop-up menu, goto the "WPF Components" tab, select ALL items and click the checkbox of the last item (to make all tools visible), then click the OK button... then (if you want) right-click on the toolbox and select "Sort Items Alphabetically" then go back into right-click-Toolbox ~ Choose Items ~ WPF Components; and untick all those items which don't have distinctive icon (the "default icon" is a white window with a blue border containing a "cone" which appears to be blowing red bubbles... stoners beware?!?!). You'll probably have to OK your "unticks" half-way down the list, coz you can't scroll the toolbox (too see the icons) whilst the Choose Items dialogue is open.
Cheers all. Hope this helps the next MS Victim.
Keith.
PS: For what it's worth, I still think this is a "bug" in VS2008... Resetting the toolbars should retore them to there original condition. Which, as far as I'm concerned, includes the "out of the box" WPF toolbox configuration. I presume it's lost them coz the WPF Toolbox's where/are a "tack on"... implemented as "custom" toolboxs (the same as a user-defined toolbox). Sigh.
If it's still a "bug" in VS2010 then maybe it should be reported, so that atleast it (probably) won't be propagated to 2012, or whatever comes next.
Did you try running this command in VS2008 Command Prompt-
del "%LocalAppData%\Microsoft\VisualStudio\9.0\*.tbd"
Refer to this link - http://msmvps.com/blogs/coad/archive/2010/05/07/reset-the-visual-studio-toolbox.aspx
As per this it will re-populate the data.
It's probably a bit late now, but I find if I change environment settings etc and want to get them back I open a 2nd copy of Visual Studio before I close the other Visual Studio instance. Then close the one you changed and then immediately close the 2nd version.
This normally persists your settings from the last instance closed for next time opening.

How do I get to the Design Tab in Visual Studio 2010 for Windows Form programming?

I am new to Visual Studio 2010 and I am trying to develop a Windows Form. I do not see a Design tab where I can toggle between the form design and the .cs code. How can I do this?
Thanks
The designer and code will actually be 2 separate tabs. To view the designer, right click the form in the Solution Explorer and choose View Designer. To view code, right click the form in the Solution Explorer and choose View Code.
If you have the code file open, you can right click anywhere in code window and choose View Designer.
tools -> Options -> HTML Designer then click the Enable HTML designer and restart.
I ran into this also. My problem was that without realizing it, I had deleted the declaration of the class and then saved.
Symptoms of this issue include: Wrong icon in Solution Explorer + no "View Designer" option
Moreover, if you double click the form, you result in an empty sheet.
To fix this, simply declare your class once again by double clicking on your form (in my case frmDialogs.vb), and adding the class declaration. Because my class is called frmDialogs, my code looks like this:
Public Class frmDialogs
End Class
Save. Then you will notice the icon return to that of a form, and you will have the ability to enter design mode once again: Normal form Icon and View Designer
Once again we can access the Form in Design.
I hope you find this information helpful! I tried to post with more screenshots but Stackoverflow did not let me since this is my first answer. If helpful please vote for my post as I need 10 reputation points to include more screenshots for future answers. Thanks!

Quirks of Visual Studio's property pane with WPF

Working in the visual designer of a WinForm project, when one selects an element the properties pane lists all the properties for that element. Selecting a property in the properties pane then displays a description for that property (the value of the assigned DescriptionAttribute) in a property description box immediately below the list of properties. Even without the visual designer open, one can select another item (e.g. an entry in the solution explorer) to show its properties in the properties pane and the property description box is still active and visible.
When working in the visual design of a WPF project, on the other hand, the property description box does not appear (true for both VS2008 and VS2010). Is there a way to expose it? Surely it must be available, or is this a defect?
The only page I could find in VS documentation is Quick Tour of the IDE that illustrates and describes each section of the visual designer -- except for the properties pane!
2010.02.11 Update
Since, according to Will Eddins answer, there is no way to do this (and the situation is unchanged with the just released VS2010 release candidate) I have filed a defect report against VS2010.
To show the properties pane, on the menu select View >> Properties Window. Alternatively, press F4.
Seems to me a bug too. I don't know if you got any answers from Microsoft Connect but I had a work-around which worked for me always.
First, open VS2008/2010 in waiting mode(meaning; if you have set a starting project, unset it). Go to the solution explorer panel. On the top left of the panel, you may see a box named "properties", click on it. You can alternatively press Alt+Enter.
http://i43.tinypic.com/52nxtv.png
Now, as you open the properties panel, you can see the description box down in the panel(if it is not hidden in your settings file). You may have to resize it.
Now load any project you want ;)

Why do my toolbox items disappear in Visual Studio 2008?

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?
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.
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.
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
I had exactly the same problem (after installing Windows Mobile SDK all items in the toolbox were greyed out).
I've startet the Visual Studio 2008 command line as administrator and started the following command (WARNING - all your settings are lost !!)
devenv /setup /resetuserdata /selfreg /resetskippkgs
After that the toolbox looked fine and worked like on the first day.
The idea came from this thread: connect.microsoft.com
Go to the Tools menu and choose import & export settings, then choose the 'reset all' setting, then yes. Save your current settings, after that you'll have your toolbox reappear.
Actually you may be able to add a registry key to get this to work also.
Make sure you're not in Debug mode.
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.
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.

Resources