具体方法是什么?才开始接触C#,请多多指教.

解决方案 »

  1.   

    从写paint
    或是 自定义控件
      

  2.   

    自带了好像不行,把Label放到Panel中吧,可以实现你所要的视觉效果!
      

  3.   

    第一步:自定义一个控件继承于label
    第二步:重写paint事件
      

  4.   

    我提的这个问题是为了解决红绿灯小玩意的灯是圆的问题,已经做出来圆的灯了.当然方的很简单.
    可以看看我画的圆作为红绿灯的灯.
    连接http://community.csdn.net/Expert/topic/4707/4707165.xml?temp=.2129785
      

  5.   

    using System;namespace 圆形label
    {
    /// <summary>
    /// myArcLabel 的摘要说明。
    /// </summary>
    public class myEllipseLabel:System.Windows.Forms.Label
    {
    private System.Drawing.Pen _pen;
    private int _PenWidth = 2;//线宽,描边的线的宽度
    private System.Drawing.Rectangle EllipseRect;//边缘尺寸 public myEllipseLabel():base()
    {
    EllipseRect = new System.Drawing.Rectangle(0,0,150,150);
    }

    protected override void InitLayout()
    {
    System.Drawing.Drawing2D.GraphicsPath path =
    new System.Drawing.Drawing2D.GraphicsPath();
    path.AddEllipse(this.ClientRectangle);
    EllipseRect = this.ClientRectangle;
    EllipseRect.Width -= (_PenWidth + 1);
    EllipseRect.Height -= (_PenWidth + 1);
    this.Region = new System.Drawing.Region(path);
    base.InitLayout ();
    }

    protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs pevent)
    {
    base.OnPaintBackground (pevent);
    if (_pen==null)
    {
    _pen = new System.Drawing.Pen(this.ForeColor,_PenWidth);
    }
    pevent.Graphics.DrawEllipse(_pen,EllipseRect);
    } }
    }//刚写了个类。貌似可以完成你的想法。设计的时候还可以改变尺寸。
      

  6.   

    this.label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
    this.label1.Location = new System.Drawing.Point(48, 40);
    this.label1.Name = "label1";
    this.label1.Size = new System.Drawing.Size(176, 112);
    this.label1.TabIndex = 0;
    this.label1.Text = "\r\n\r\n       TestMyLabel";
    //调用的
      

  7.   

    谢谢.高手啊.做出来了.圆形的LABEL
    代码:
    http://community.csdn.net/Expert/topic/4707/4707165.xml?temp=.875149