using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Data;
using System.Text;
using System.Windows.Forms;namespace WindowsControlLibrary1
{
    public partial class UserControl1 : System.Windows.Forms.UserControl
    {        private System.ComponentModel.Container components;
        
        private Pen curvepen = new Pen(Color.Blue);
        private Point pt1 = new Point(0, 0);
        private Point pt2 = new Point(10, 30);
        private Point pt3 = new Point(50, 20);
        private Point pt4 = new Point(100, 40);
        
        
        
        
        
        
        
        
       public UserControl1()
        {
            InitializeComponent();
       
        }
        public void InitializeComponent()
        {
            components = new System.ComponentModel.Container();        }        public override void Dispose()
        {            base.Dispose();
            components.Dispose();
        
        
        
        }        
        
        public Point PT1
        {
            get
            {
                return pt1;
            }
        set{
            pt1 =value;
           Invalidated();
        
        
        }
        
        
        }        public Point PT2
        {
            get
            {
                return pt2;
            }
            set
            {
                pt2 = value;
               Invalidated();
            }
        }
        public Point PT3
        {
            get
            {
                return pt3;
            }
            set
            {
                pt3 = value;
                Invalidated();
            }
        }
        public Point PT4
        {
            get
            {
                return pt4;
            }
            set
            {
                pt4 = value;
                Invalidated();
            }
        }
        protected override void OnPaintBackground(PaintEventArgs e)
        {
            Rectangle r = new Rectangle(0,0,this.Size.Width,this.Size.Height);
            LinearGradientBrush lb = new LinearGradientBrush(r,Color.Red,Color.Yellow,LinearGradientMode.BackwardDiagonal);            e.Graphics.FillRectangle(lb,r);
        
        
        
        }        protected override void OnPaint(PaintEventArgs e)
        {            base.OnPaint(e);
            e.Graphics.DrawBezier(curvepen,pt1,pt2,pt3,pt4);
            e.Graphics.DrawEllipse(curvepen,pt1.X-1,pt1.Y-1,3,3);
            e.Graphics.DrawEllipse(curvepen, pt2.X - 1, pt2.Y - 1, 3, 3);
            e.Graphics.DrawEllipse(curvepen, pt3.X - 1, pt3.Y - 1, 3, 3);
            e.Graphics.DrawEllipse(curvepen, pt4.X - 1, pt4.Y - 1, 3, 3);
        
        
        
        }       
        
        
        
        
    }
}
清高手解决并运行成功!谢谢