C#我照书上打的代码,但是出现了这个错误怎么改
C#我照书上打的代码,但是出现了这个错误怎么改就是想在窗体里出现一条直线usingSystem;usingSystem.Collections.Generic;using...
C#我照书上打的代码,但是出现了这个错误怎么改就是想在窗体里出现一条直线using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Drawing.Text;
namespace WindowsFormsApplication7
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public void DrawLine(Pen pen,Point startPoint,Point endPoint);
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
Pen pen = new Pen(Color.Blue,3);
Point startPoint = new Point(20,20);
Point endPoint = new Point(200,90);
g.DrawLine(pen,startPoint,endPoint);
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
} 展开
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Drawing.Text;
namespace WindowsFormsApplication7
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public void DrawLine(Pen pen,Point startPoint,Point endPoint);
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
Pen pen = new Pen(Color.Blue,3);
Point startPoint = new Point(20,20);
Point endPoint = new Point(200,90);
g.DrawLine(pen,startPoint,endPoint);
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询