发布网友 发布时间:2022-04-24 02:49
共1个回答
热心网友 时间:2023-10-22 21:26
这需要用到多态 具体代码如下 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Drawing.Drawing2D; namespace 窗体重写{ public partial class MainForm : Form { public MainForm() { InitializeComponent(); } protected override void OnPaint(PaintEventArgs e) { //重写父类窗体的方法 Point[] points = new Point[] { new Point(2, 1), new Point(55, 25), new Point(110, 200), new Point(99,200), new Point(77, 117), new Point(22,123)}; GraphicsPath path = new GraphicsPath(); //GrapjicsPath是图形路径 path.AddCurve(points); //增加曲线的点 this.Region = new Region(path); //Region本窗体的区域 } 这是完整代码 坐标点可以自己修改一下热心网友 时间:2023-10-22 21:26
这需要用到多态 具体代码如下 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Drawing.Drawing2D; namespace 窗体重写{ public partial class MainForm : Form { public MainForm() { InitializeComponent(); } protected override void OnPaint(PaintEventArgs e) { //重写父类窗体的方法 Point[] points = new Point[] { new Point(2, 1), new Point(55, 25), new Point(110, 200), new Point(99,200), new Point(77, 117), new Point(22,123)}; GraphicsPath path = new GraphicsPath(); //GrapjicsPath是图形路径 path.AddCurve(points); //增加曲线的点 this.Region = new Region(path); //Region本窗体的区域 } 这是完整代码 坐标点可以自己修改一下热心网友 时间:2023-10-22 21:26
这需要用到多态 具体代码如下 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Drawing.Drawing2D; namespace 窗体重写{ public partial class MainForm : Form { public MainForm() { InitializeComponent(); } protected override void OnPaint(PaintEventArgs e) { //重写父类窗体的方法 Point[] points = new Point[] { new Point(2, 1), new Point(55, 25), new Point(110, 200), new Point(99,200), new Point(77, 117), new Point(22,123)}; GraphicsPath path = new GraphicsPath(); //GrapjicsPath是图形路径 path.AddCurve(points); //增加曲线的点 this.Region = new Region(path); //Region本窗体的区域 } 这是完整代码 坐标点可以自己修改一下热心网友 时间:2023-10-22 21:26
这需要用到多态 具体代码如下 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Drawing.Drawing2D; namespace 窗体重写{ public partial class MainForm : Form { public MainForm() { InitializeComponent(); } protected override void OnPaint(PaintEventArgs e) { //重写父类窗体的方法 Point[] points = new Point[] { new Point(2, 1), new Point(55, 25), new Point(110, 200), new Point(99,200), new Point(77, 117), new Point(22,123)}; GraphicsPath path = new GraphicsPath(); //GrapjicsPath是图形路径 path.AddCurve(points); //增加曲线的点 this.Region = new Region(path); //Region本窗体的区域 } 这是完整代码 坐标点可以自己修改一下