C#系统。绘制参考问题
当涉及C#,C ++(c Ethity)和Visual Studio时,我是一个菜鸟。
我正在尝试使用图表绘制表,
public override void OnPaintChart(PaintChartEventArgs args)
{
Graphics gr = args.Graphics;
Font font = new Font("Arial", 10);
for (int i = 0; i < KeyLevel.Length; i++)
gr.DrawString(KeyLevel[i].ToString(), font, Brushes.LightGray, 20, 23 * i + 30);
}
但我会收到以下错误: “类型'图形'是在未引用的汇编中定义的。您必须将引用添加到汇编'system.drawing.common,version = 6.0.0.0,culture =中性,中性,publickeytoken = cc6 .... ...”
如果我右键单击我的项目,然后去添加&gt;参考,唯一可用的系统。绘图显示为版本4.0.0.0。
我已经更新了Visual Studio并更新了.NET。
我已经说/引用了? (不知道术语)
using System;
using System.Drawing;
在我的脚本开头。
如何获得6.0.0.0版本?
我真的很坚持。
提前致谢。
I'm a total noob when it comes to C#, C++ (C anything) and visual studio.
I'm trying to draw a table over a chart using
public override void OnPaintChart(PaintChartEventArgs args)
{
Graphics gr = args.Graphics;
Font font = new Font("Arial", 10);
for (int i = 0; i < KeyLevel.Length; i++)
gr.DrawString(KeyLevel[i].ToString(), font, Brushes.LightGray, 20, 23 * i + 30);
}
but i'm getting the following error:
"The type 'Graphics' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Drawing.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc6......."
If I right click my project and go to Add > References, the only available system.drawing is showing as version 4.0.0.0.
I've updated visual studio and updated .net.
I've stated/referenced?? (dont know terminology)
using System;
using System.Drawing;
at the beginning of my script.
How do i get version 6.0.0.0?
I'm really stuck with this.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决方案如果有人遇到相同的问题。
更新到Visual Studio 2022。
在Visual Studio中更新.NET
,右键单击Project&GT;管理Nuget软件包
搜索图纸和安装软件包。
在微软发誓要使生活艰难。
完毕。
Solution if anybody runs into same problem.
Update to Visual Studio 2022.
Update .net
In visual studio, right click project > Manage NuGet Packages
Search drawing and install package.
Swear at Microsoft for making life hard.
Done.