XCeed WPF Toolkit -use Controls on Designer - c#

I have problems to use the Extended WPF Toolkit controls in the XAML designer
environmet: Win8.1, WPF Toolkit 2.1.0.0, MS VisualStudio Express 2013
What have I done?
- Downlod the actual "Extended WPF Toolkit Binaries" from Codeplex-Homepage, unzip....
- include the Xceed.Wpf.Toolkit in my project - referencies ( o.k )
- in Toolbox: Add a new Tab "WPF Toolkit Extended" ( o.k )
- in the new registercard: Add Items. I see all the about 70 customs controls (ex. SingleUpDown and so on) (o.k)
- I try to drag and drop a custom (ex. SingleUpDown) to my main window. DOESN'T WORK
I get a messagebox (in german, I try to translate)
" a reference "XCeed.WPF.Toolkit, Version 2.1.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4" was added to the project. Press OK to restart the XAML Designer, that you can use the new types / controls out of the new referencies. After restart of the XAML designer you should do it again.
When I restart the Designer, or VisualStudio or even the computer, its always the same message. And I do not see the reference to the toolkit in the XAML designer.
I surely also tried all the referencies and hints on the codeplex installation site:
Add a using statement ("using Xceed.Wpf.Toolkit;") to the top of .cs files
Add a new xmlns (for example, xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit") to the top of XAML files
In your XAML, use the namespace prefix (in the above example, )
But this also doesn't work.
Is there any idea, why I am not able to drag and drop the controls to my main window and what is wrong in my approach. (I am pretty new to C# and WPF)
SORRY SORRY SORRY SORRY SORRY SORRY SORRY SORRY SORRY SORRY SORRY SORRY
I just solved it by additional google search. problem is to unblock properties after DLL-Downloads. My salvation was this comment:
This is a common problem when downloading files from thw web. Simply go to the folder where you downloaded the DLL. Right-click the DLL and select properties. Near the bottom of the properties dialog there should be a button that says "Unblock". Click that and you should be good to go.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I think the best solution is to add the WPF toolkit via Nuget.
If you don't have nuget already installed, go to Tools -> Extension and Updates in Visual studio. On the online section you should find Nuget easily it always appear on top, then click "download"
Once Nuget installed, right click on your project in the solution viewer and click on "Manage NuGet packages"
In the menu search for the Wpf Toolkit, and click on "install"
This way you are sure that the library is added correctly.

Related

Missing "Resource Dictionary" in menu "Add item" in VSTO solution

In Ms Word I'm trying to add TaskPane with WPF controls.
I know that I have to add host winforms control to taskpane and later add wpf contorls to this host.
Its works for me and everythig works.
But when I want to properly add pretty wpf control using resource dictrionary I cant, bacause there isnt't resource dictrionary on list to add from "Add->New Item..." menu.
There is no problem with other wpf projects, but in VSTO I can't.
Checked on Visual Studio 2019 and 2022.
Using search on this window don't find proper resource template.
What am I doing wrong?
Or maybe it's not VSTO's fault but something completely different?
It's not the most elegant way to get around this but at least it's a way around:
Add a user control to your folder
Open the XAML and remove all the user control references and make it look like below
< ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
< /ResourceDictionary>
go to solution explorer and expand the subfiles in the XAML that you want as a resource and delete the .cs
how to delete the folder
Hope this helps

How can I add multiple WinForms Toolbox Controls from one VSIX Project?

I followed this; Create a Windows Forms Toolbox Control from msdn, and was able to successfully create my own custom toolbox control and install it and use it. Perfect.
But, when I try to add another control file to it-for example in solution explorer I have ProjectName and then inside of that I have CustomToolboxControl1.cs(which works fine) and then I have CustomToolboxControl2.cs. CustomToolboxControl2.cs; for whatever reason does not appear in the toolbox, everything compiles fine with no compile or runtime errors, and I set it up exactly like I did the first one.
I've tried searching Google, YouTube, StackOverflow(Which I came across a few "solutions" that didn't work for me 'cause it was way outdated from like '08 and such), and can not for the life of me find out how to add multiple custom WinForms UserControls from one VSIX project. Not sure if I'm just not wording my searches correctly or not but...Here I am, makin' my first post here on StackOverflow. Hopefully I'm doin' this question thing right, it seems like a lot of SO posts I come across are people just getting anal in the comments about how the question was asked lol.
Here's some images that will hopefully further help:
The controls are CoffeeComboBox(the one that works) and CoffeeTabControl(the one not showing up in toolbox but compiles fine and is setup the same way as the other one):
Solution Explorer
And here's what it looks like in the debugging instance of Visual Studio Toolbox:
Visual Studio Debug Instance Toolbox
Nevermind, I solved it.
I did everything correctly, but the Visual Studio Instance was just buggy. I decided to close VS, try installing the VSIX project anyways, and then testing it on an actual new WinForm project rather than just a debug instance of VS. It showed up just fine in the toolbox there. Was able to drag both of my custom tools that were properly placed under the specified custom tab, from the toolbox to the form just fine.
For anyone else that may come across this question, to further elaborate;
If you follow this guide to Create a Windows Forms Toolbox Control from the msdn(Microsoft Documentation) site, just rinse and repeat for any additional UserControl WinForms Controls that you want to add. To do that; Right click the project name > Add > New Item... > Extensibility > Windows Forms Toolbox Control > giveItAName.cs > Click Add bottom right. Done.
Closed.

New Blank Page(XAML) projects = Controls are not showing on the MainPage(only their borders are)

I'm new to Visual Studio and couldn't find my answer anywhere else for hours over the internet..
I'm Using "Visual Studio Express 2012 for Windows" and everytime I create a new project with a blank page (XAML), the designer only shows me the frame of the page with its missing background.
And any control I drag to it, is invisible (I can only see the square border of the control I dragged but no texture..)
This is only happening during design time. On RunTime it actually shows up..
This is happening to me since I had the first fresh install. Just to be clear, I am NOT opening an existing previous project.. I have non. This is the first time I make a project in C# and I'm surprised I didn't find anything useful so far over internet search..
Also tried installing, uninstalling, repairing and changing to different versions...
The problem didn't show on Visual Studio 2012 Express for Desktop, but this product doesn't seem to be fit to my needs.. (I'm trying to also learn how to develop for Windows Store and other products)
The IDE doesn't show any errors or warnings..
Help would be much appreciated!
P.S - I'm running Windows 8.1
You can try Blend to open the project and render the xaml,if the problem appear too, maybe you should check out your graphics card or update driver.
try with this!
Check the following:
Tools -> Options
Expand Text Editor -> XAML -> Miscellaneous
Make sure that "Always open documents in full XAML view" is not checked
Or perhaps the default program for opening .xaml files has changed:
Right-click your .xaml file in Solution Explorer
Click Open With...
Select XAML UI Designer
Click Set as Default button
Click OK
If it's related to the video driver, maybe disabling hardware acceleration will help?
Or you could try Visual Studio Community Edition (http://www.visualstudio.com/, click on the Download button under "Free developer tools"
Did one of these suggestions work?

How to find chart control under my toolbox?

As you can see in my screenshots below, I don't have an option chart under my toolbox. I checked and seem to have the proper references in place. I don't see any option to add the chart control either. Please help. Tnks.
reference
toolbox
no option to add chart control
The References under Solution Explorer only refers to what you can use in code. Toolbox items have to be added separately. To do this, right-click inside the Toolbox and select Choose Items.... In the dialog that appears select the tab referring to the type of control (in this case it looks like WPF). Scroll through the list to find the controls you want to add, tick them and click OK. The controls should now be available in the Toolbox. You can add extra tabs/sections to the Toolbox with the Add Tab right-click option.
That's a good question - I needed to search for a solution when I first tried to add new controls to the Toolbox!
Hope this helps! :)
I suggest you to use devexpress..
Install devexpress first..
After installing , restart you visual studio,, open a windows form application
and
Try devexpress..
Add " New Tab" in your tool box.
Right Click Tab and "Choose Items"
You can select dll files there. selec all related files and click ok
when you are done, just drag and drop chart control on you application, the reference will automatically updated.
The Chart is not a standard feature control of .NET 3.5 although it can be installed from a separate download. It is only standard in .NET 4.0 or higher. It is Not available at all (no separate download) for .NET 3.0 and below!
If you can, do change your project to .NET 4.0 to make the Chart control present in the Toolbox and then be able to add it to your forms. I have learnt this the long way...

Can I use a UserControl from the same project without making a DLL?

I made a User Control and already was able to use it by adding it to a form in the C# code. The User Control is in the same VS2005 Project as the main form.
The problem is that I can't see the User Control in the gui editor ([Design] window) with this implementation. I tried many things but I wasn't able to add the user control to the real form desing.
I read some things about making a control lib dll and then add this dll to the toolbox but I don't want to have an additional project and an additional binary file.
How can I use a User Control in an form Design, if both are in the same VS Project? I think somehow this should be possible?
Edit 1:
Sorry I have Visual Studio 2005 not 2010
It's certainly possible to use a UserControl in design mode when it's part of the same project.
Do note, however, that it will only show up in your toolbox if you have enabled the "AutoToolboxPopulate" setting. Go to the "Tools" menu and select "Options". Expand "Windows Forms Designer", and click on "General". Make sure that the "AutoToolboxPopulate" property is set to True. When you rebuild your solution, your UserControl should show up at the top of your toolbox, ready to add to your form.
Alternatively, you can add the UserControl to your toolbox manually. To do that, right-click on your toolbox and select "Choose Items" from the context menu. Navigate to your control, ensure that it is checked in the list, and click "OK".
In the event that an exception is thrown (like MacX mentioned), you will still be notified by the designer. The control will still show up in the toolbox, and you'll still be able to attempt to add it to your form.
As APShredder already mentioned the control should automatically appear in the toolbox. If it doesn't check your Visual Studio Settings:
Tools - Options - Windows Forms Designer - General - AutoToolboxPopulate - True
For further informations just read the Walkthrough in the MSDN.
You should be able to use a custom User Control in the Winforms designer. You have to build your project first however. You can do this by going to Build --> Build Solution or by pressing F6. Then your control should appear in the Toolbox.
Yes, in the toolbox, right-click and choose "Choose items...". Then navigate to the ".NET Framework Components" - your controls should be listed in there. Just choose to add them.
There should be no Problem with the Control, except you have an exception which is thrown within the constructor or the Load-Event. The the Designer is not able to display the control correctly.
In VS2010 after you create a User Control and compiled it, VS add automatically your component and make it visibile in his namespace on ToolBar.
This can be done in Both WPF and old style code/Components...

Categories