I have created new WinForm project and have installed SharpGL package for WinForms: Install-Package SharpGL.WinForms, but appropriate controls did not appear in toolbox.
How to make them appear?
note: This samples https://github.com/dwmkerr/sharpgl/tree/master/source/SharpGL/Samples/WinForms
already has SharpGL controls in toolbox.
try_1: When I click 'choose items...' in toolbox context menu "choose item" window is opened but starts loading and hang visual studio.
try_2: I also tryed to set Options -> Windows Forms Designer -> AutoToolboxPopulate to true and rebuild solution but it doesn't work.
try_3: Waited a while in "choose item" window, clicked browse button and navigate to SharpGLWinForms.dll in packages folder, klicked ok but only GLColourPiker had been added into toolbox. (I wanted OpenGLControl and other control of this lib)
try_4: Repeat try_3 several times and appropriate controls finally appeared. But why I had repeat this step to get the result. What wrong I did?
Had same problem.
In order to make designer work with this control I had to make it somehow visible in my Toolbox.
So in my project I:
Created new UserControl that I named 'GLViewportControl' and made it inherit from SharpGL.OpenGLControl instead of plain UserControl.
Enabled DrawFPS in designer just to check.
Rebuild.
Designer fails.
Rebuild.
Designer works.
Profit.
Good Luck.
Related
I want to make a composite control which I could drag to form multiple times, but this control should reside in one project only. I do not like the idea of making a control, and installing it to be visible to all projects in a Visual Studio 2010 Toolbox.
So, I assumed that the UserControl is what I needed. I created one, but now can't drag it to a form or find it in the Toolbox.
Tools > Options > Windows Forms Designer > AutoToolboxPopulate is set to True.
I had to compile the project to make UserControl appear in the Toolbox.
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
When the WPF window is opened in design view in Visual Studio, the Toolbox pane automatically loads WPF controls into "Common WPF Controls" tab and "All WPF Controls" tab.
Does anyone know how Visual Studio does this?
Seems like they would be loaded through either the Project References or the (more likely) user options saved when you rightclick on the tookbox and choose "Choose Items...".
I would imagine that somewhere, there is a setting where by default when a XAML page is open, it loads a bunch of items in System.Windows.Controls into the Toolbox. If you want, you can deselect those items you dont want, and put different items in the toolbox
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.
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.