Chart tool is greyed out in Visual Studio - c#

I'm trying to add a chart to my Visual Studio form but the button is greyed out. I'm using .NET Framework 3.5 and C#. Following instructions online I've downloaded and installed the dll files from this link: http://www.microsoft.com/en-us/download/details.aspx?id=14422
I also added them as references and added the following line at the top of my form file:
using System.Windows.Forms.DataVisualization.Charting;
but the button is still greyed out.
What have I missed?

To make the chart control available, you need:
To be using .Net framework 4.0 or higher, OR for .Net framework 3.5 install this: http://www.microsoft.com/en-us/download/details.aspx?id=14422
On the toolbox context menu -> Choose Items... have the Chart control selected. (Sort by name in the Choose Toolbox Items dialog and scroll to Chart. There are two: one for Windows forms, one for Web forms. You need only select what's relevant.)
The chart control appears in the "Data" section of the Toolbox.
You do NOT need to any any "using" clause to the form source file, or any reference in the project references. (The reference is added automatically for you when you add the control.)

I too had this issue and could not resolve it for hours.
As posted here:
Visual Studio 2010 toolbox controls disabled or inactive
In order to solve it for me I just right-clicked one of the items in the toolbox, and chose "Reset Toolbox"
This resets the entire toolbox, so as mentioned in the answer above, all custom tools are lost and need to be re-imported.

Had the same problem.
What I did was to make sure that I was using the same Framework with the chart framework version.
During project creation, by default using .net 3.5. But since the chart is written for Framework 4.0, it will not work with 3.5.
You need to change the solution or project Framework to 4.0 or above by doing this:
On the menu bar of Visual Studio, click <your project name>/Properties.
Change target framework to 4.0 or above.
Save the properties setting.
Rebuild your solution.
After this, you may use that chart component.

Related

.NET Core UserControl missing from toolbox

I'm using .NET Core 3.1 Windows Forms from Visual Studio 2019 16.7.0 Preview 2.0. I created a UserControl as part of the same project that contains the forms I want to add the control to. From experience with Framework it should appear in the toolbox when I rebuild the solution but it's not there. I sometimes had that issue with Framework and fixed it by selecting Choose items>Browse and choosing the app executable, but doing so with my .NET Core app simply says the file is not valid. The same appens selecting any DLL in the solution folder. Are there any other way I could add the control to the form? I tried editing the designer manually based on existing code for the other controls, but all references to the new control were deleted when building.

Why my C# Project properties has no target framework and no combo box choices?

I downloaded AvalonDock from GitHub and I open in in Visual Studio.
There is no "Target framework" and the ComboBox list is empty and the ComboBox is disabled.
Anybody know why?
Note: I have a .net Core WPF application and add AvalonDock project as a dependency and everything works well.
The reason is most likely because of Multi-Targets.
Open the project in Notepad, or Visual Studio by right clicking the Project name, and selecting 'Edit Project File' (if available), and look for a line like this:
<TargetFrameworks>netstandard1.4;net40;net45</TargetFrameworks>
Here is more information from Microsoft:
https://learn.microsoft.com/en-us/dotnet/standard/frameworks
Unfortunately, there is no Gui way to Multi-target, so that is why you will not see a target framework in your project.

ZedGraph doesn't works in Visual Studio 2012

Anyone used ZedGraph in VS2012 ?? When i try load component i get error message that "There are not Component in zedgraph.dll that can be placed on toolbox".
I can't find info does zedgraph works on VS2012.
Please recommend me some library to plot graph of math functions, thx
You first need to add the ZedGraphControl to your toolbox. The instructions on the Zedgraph CodeProject page works for Visual Studio 2012 as well:
ZedGraph is accessible as a control from the control toolbox in Visual Studio .NET. To access ZedGraph, first launch Visual Studio .NET, and create a new Windows Application (Forms) project. Open the form design so that it appears in the current window. View the toolbox using the View/Toolbox menu command. Right-click inside the "General" or "Components" sub-pane of the tool box, and select the "Choose Items..." option. Click "Browse...", and navigate to the ZedGraph.dll file. Once this file is added, you should see a ZedGraphControl option in the toolbox.
If you want to use an alternative charting library, please be aware that .NET 4 and later contains the .NET Charting library for Windows Forms out-of-the-box, see here.
Just go to nuget package manager console and:
Install-Package ZedGraph
It will install what you need and it will be working

.NET 3.5 Chart Controls Disabled

I've been using .NET 4.0 C# Windows Form Application utilizing the chart controls to render a chart on my form. I've recently had to switch to .NET 3.5 to use a reference that doesn't support 4.0. Now, I can’t use the chart controls for my application.
I’ve downloaded and installed the recommended packages:
Microsoft Chart Controls for Microsoft .NET Framework 3.5
http://www.microsoft.com/download/en/details.aspx?id=14422
Microsoft Chart Controls Add-on for Microsoft Visual Studio 2008
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=23903
But my problem is that I am using Visual Studio 2010, the add-on is only for vs2008.
I had to select 'Show All' on the toolbox in order to even see the chart option, but now it is disabled and when I attempt to click and drag I get a error icon as my mouse pointer.
I tried to upload the image that shows the disabled chart, but SO wouldnt let me.
Is there any way that I can use the .Net 3.5 Chart Controls with VS2010?
Thanks,
Bryan
Right click into toolbox
choose items...
filter for "chart"
check out chart-checkboxes
Now they should be available.
If you upgraded to framework 4.0, remove manually added references of chart control, because framework 4 already has chart control.
Go to Project|Application properties and change your target framework to .NET Framework 4. It will close the solution and reopen it by itself. your chart control will be enabled.
This is how I included chart in .net 3.5. Download the dll from "https://www.nuget.org/packages/System.Windows.Forms.DataVisualization/". You can check the license there. Now open visual studio/visual c# express(In my case it is Visual C# express 2008). Go to Tools->Choose ToolBox Items-> In the window there would be a "browse" button in the bottom side. Browse the downloaded dll. Now it will show the "Chart" control in the same window's ".Net Framework Components" tab.Now click on it and press "OK". Now go to your toolbox , there you can find the "Chart" Control.

DevExpress Toolboxes don't get created on Visual C# Express

I installed DevExpress v2011 vol 1 on my Win7-32 Home Premium computer running Microsoft Visual C# 2010 Express.
The DevExpress controls do not appear in the ToolBox. I tried running the ToolboxCreator program with logging, and it resulted in:
VS 2005 not found
VS 2008 not found
VS 2010 not found
It looks like I can manually add DevExpress controls to the ToolBox by doing the "Choose Items..." method and selecting a DevExpress tool, but that's a lot of controls, and even though I specified to only install the WinForm controls, it looks like a lot of web controls are there, too.
Is this the way I have to do it, or is there a better way?
It seems like this is a known problem according this post. The post acknowledges issues with VS Express, and links to this support article. Unfortunately, it says:
It is possible to use our ASP.NET and WinForms products in Express Editions, but you will have to manually add the required product items to your Toolbox. This can be done via the "Choose Items..." command of the Toolbox' context menu as described bellow.
So, sorry, there doesn't seem to be an easier way; I am guessing DevExpress themselves would be suggesting it if there were.
I resolved the issue in the following manner. I ran the devexpress toolboxcreator. But after that the toolbox was still abscent any devexpress controls. Then I right clicked the toolbox and selected 'Reset toolbox'. Maybe that would have worked if i'd tried it first, but it did the trick for me!
Note that if you use 60 free DevExpress controls then you should use only DevExpress.Utils.v11.2.dll and DevExpress.XtraEditors.v11.2.dll (for winforms) like in this video http://www.youtube.com/watch?v=QovScQvyvNM
DevExpress Controls not showing up (disable) in Visual Studio toolbox:
This issue was caused by the application Target Framework being set to .Net Framework 2.0
once the Target Framework was changed to 4.0, the controls became available in the Toolbox.
To change the Target Framework in Visual Studio:
For VB.net:
Right click the project in the Solution Explorer and click Properties...
On the Compile tab, click the Advanced Compile Options... button
Change the Target framework (all configurations) to .NET Framework 4.
For C# .net:
Right click the project in the Solution Explorer and click Properties...
Click the Application tab and change the Target framework to .NET Framework 4.
After that you need to repair toolbox by right clicking on toolbox tab, where controls exist.
Visual Studio will close automatically and will reopen after some configuration will apply.
Now you will find all devExpress Controls available on toolbox..

Categories