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.
Related
We make a C++ ActiveX control for years now. It's now built using VS 2019.
When I create a new .NET Framework v4.8 WinForms project I can add my ActiveX control to the toolbox in VS2019 and drop it on my form.
But when I create a new .NET 5 WinForms project using VS2019 or a new .NET 6 WinForms project using VS2022 I can look up the ActiveX control when using Choose Items .. but when I select the control I get this error:
The following controls were successfully added to the toolbox but are not enabled in the active designer
Make sure the controls to add are compatible with the current designer and .NET Framework version
I can however create the control using code in the designer and at run-time, the application works as expected. I can't open the form in design time, that will generate an error.
Most likely I need to update my ActiveX control to make it more compatible with .NET Core, but I can't find what.
Can anybody offer advice?
It seems this is by design.
Microsoft decided to not put back the ability to use ActiveX controls in the Forms designer when using .NET.
When you need this, you can vote for it on https://developercommunity.visualstudio.com/t/support-for-activex-controls-in-windows-forms-desi/1435698 and perhaps before the end of the century, it will be implemented.
Recently I update my Visual Studio 2019 to the latest version and create Windows Forms application in .NET Core 3.1 (not preview version).
In the form design toolbox I can not find button control but other controls are on the list.
I used to search for it on the top of the list(Toolbox) but could not find Button control.
What's wrong? Should I reset or install something?
Sorted alphabetically:
This question already has an answer here:
Form designer view is not available in visual studio 2019 C# CMake project
(1 answer)
Closed 2 years ago.
I checked out a C# Windows Forms App (.NET Framework) from GIT and was looking around and making some modifications to the code and the form. At some point the next day I no longer have any View Designer or View Source in the View menu or when right-clicking the file in Solution Explorer. Also, double-clicking the file just brings up code view.
It successfully Builds, Executes, displays the form and functions correctly.
I can't find an option under File > New File (only Web Form) or anywhere else to add a new form and Solution Explorer shows:
I have done quit a bit of searching and everything seems to point to using .NET Core (which doesn't support Form Designer, without possibly an external package) instead of .NET Framework which is not my case.
If I create a new C# Windows Forms App (.NET Framework) I do have Form Designer and the ability to view code and form.
Is this a setting in the Project/Solution or in the IDE? How can I get Form Designer back? I'm not sure where to look to prove in the question that it is .NET Framework and not .NET Core, but forms were working yesterday.
It looks like the view of your project got switched to Folder View.
Click on the Toolbar in the Solution Explorer and switch the view to Solution View.
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.
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..