Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lesson 2.2 - adding the button in design view messes up the form #329

Open
benlhroberts opened this issue Jul 18, 2022 · 2 comments
Open

Comments

@benlhroberts
Copy link

Hi. I've seen a post on the Gitter chat but thought I'd mention it here as well. When opening the Main form designer, it doesn't show the chart, which isn't a major issue, but if the form is altered in any way (like adding the button in lesson 2.2), all of the charting controls (chartArea1, legend1, series1) get deleted from the form and it no longer works.

The easiest solution is just to copy the code from Main.Designer.cs in the Completed folder, but this was a bit confusing at first so thought it best to flag it here. Thanks.

@zvrastil
Copy link

Yes, the problem is that project is targeting .NET Core, but VS Designer does only work correctly with DataVisualization components in .NET Framework. If you really want to follow the instructions, you have to recreate the project as .NET Framework Windows Forms application. Then, the designer works correctly.

Seems like Petabridge updated the projects to .NET Core without actually checking if the instructions still work when followed step by step.

@gavinjcooper
Copy link

I was able to fix the designer by replacing the System.Windows.Forms.DataVisualization nuget package with WinForms.DataVisualization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants