I'm starting with the Head First C# book and right off the bat I can't get my screen to look like how it looks in the book. It wants me to open Visual Studio, create a new Windows Forms Application and the picture they have shows Design View which has a blank form in the center and on the left, there's a Toolbox with bunch of windows form items to drag to the center, such as pointer, button, checkbox, label, listbox, etc. When I'm searching online how to get this Design View, everyone says select the form in the solution explorer and either right click and select Solution Designer or click Shift+F7. All this does is goes to the code in the center of the screen. How do I get to see the visual part of the form instead of just the code?
The .NET Core implementation of Windows Forms does not include a designer by default as it is still a preview feature.
The instructions to install the preview designer can be found here:
https://devblogs.microsoft.com/dotnet/introducing-net-core-windows-forms-designer-preview-1/
Alternatively, and more likely what you want to do is use the full .NET Framework for your Windows Forms application.
To do this, when creating the project in Visual Studio there will be a project type called 'Windows Forms App (.NET Framework)'
I had a similar issue. It turns out I was opening the Folder my program was in and not the Solution file. When I opened solution, it worked as expected.
EDIT: This is from right-clicking the .cs file in Solution Explorer. The Shift + F7 also doesn't work if you opened it as a folder rather than a solution.
Related
When I create a new Windows Desktop Form Application using .NET Core with the latest Visual Studio 2019 Community Edition update, I cannot view the design view of the form, i.e., Form1.cs[Design]. When I click on the appropriately labeled Form1.cs file, it only opens up the code view.
New Solution Open Form1.cs code view only
Edit: At the time the question was asked Microsoft hadn't released the visual designer for WinForms in .NET Core in Visual Studio 2019. It needed a separate preview install. By May 2020, Visual Studio version 16.6, the designer was still in preview but could be enabled from Tools/Options/Environment/Preview Features/'Use the preview Window Forms designer for .NET Core apps' without needing an install.
As of November 2020 the designer is still in preview, but is enabled by default in projects in Visual Studio 2019 version 16.8 and later. It's still not complete, particularly re data binding, but the number of issues is much smaller. It can now be disabled via the Tools/Options menu as discussed above.
Took me a while, but...
Apparently, according to this page, you can bring up form designer in the following mysterious steps:
In the Solution Explorer, look for the head toolbar,
Find the icon that looks like an empty HTML tag: <>
When you click it, it will disappear, which makes no sense, but then,
Your plus signs (tree expand buttons) on the left side of the files will be gone too - that's a good sign:
Now you can doubleclick on your Form1 (or whatever it's called),
And after a few seconds of thinking, it will open the Form Designer.
Why this?... I literally have zero idea. But it worked for me.
Maybe tomorrow I'll find out more about this and yes I promise to come back and update - until then, just follow this little yellow brick road. I hate the fact that in 2021 some of the modern tools require dark sorcery to operate on a basic level, but hey. We're in this together.
Good luck!
This thread is the first when requesting "c# visual studio 2019 cannot open designer", so the solution may be useful for those who have encountered an error when the WinForms constructor stopped opening in VS2019.
The screenshot shows the steps to DISPLAY the ERROR that caused WinForm to stop displaying
I found this trick worked for me:
Right click your project in Solution Explorer and select 'Unload Project' from the context menu (near the bottom).
Right click again and select 'Load Project'
Now when you double click on your form class, it opens in the design editor
I have Visual Studio Enterprise 2015, with all updates and patches applied. When I build create a new Visual C# project Templates->Cross-Platform->Blank App (Xamarin.Forms Shared) I get the following error:
A problem was encountered creating the sub project '.Windows'. This project requires a Visual Studio update to load. Right-click on the project and choose 'Download Update'.
When I click Ok, a solution and projects are created but there is no .Windows, so I cant right click on it! If I try add the project then I get the same issue.
I would expect that such a simple use case should work out the box. I can find a few workarounds via Googling but I don't want to hack around with projects before I even write a line of code of my first Xamarin application.
Any ideas on what I need to do to get the project creation working properly "out of the box"?
A second puzzler is that the template creates a .WinPhone folder that is empty, should I have a csproj in it?
Close Visual Studio and try to modify it components (Control Panel -> Uninstall a program -> Microsoft Visual Studio -> click on it).
In opened window click on "Modify".
Then find and select "Windows 8.1 and Windows Phone 8.0/8.1 Tools" (in Windows and Web Development)
Then click on "Update".
also make sure the Hyper-V is enabled :
Control Panel -> Uninstall a program, then in left menu "Turn Windows Features on or off" and find "Hyper-V", if it isn't selected, select it and click "ok".
I am using Visual Studio Express 2013 to create desktop applications (c# WPF and forms) on Windows 7 Pro. I have read that Paint will create icon files (as I understand they are some kind of bitmap but with an ico extension). When I start with an existing and usable icon, change it in paint and save it I can no longer use it for the icon in my applications. Has anyone actually been able to do this? I've read several posts with conflicting information but it seems that it may be possible. I think that the normal paid version of VS will make this easier, but I'm an architect (buildings) not a software developer so not likely to spend money to get that functionality.
If you include your icon file as a file in your project (Add Existing Item...), you can then right click on it, and select Open.
This will open an icon editor inside VS. An toolbar will appear that will have all the tools that you want to help edit your file.
You can do the same thing with just about any type of image.
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
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..