lblPstart.BackColor=Color.Transparent;
这条语句用了背景还是不能透明。

解决方案 »

  1.   

    我用:this.label1.BackColor = System.Drawing.Color.Transparent;可以透明啊!
      

  2.   

    在窗体的Load事件中加上这句代码试试看
    SetStyle(ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true);
      

  3.   

    在窗体的Load事件中加上这句代码试试看
    SetStyle(ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true);
    这么做是使窗体可以使用透明色。
      

  4.   

    你的控件放在哪了,后面有没有picturebox
      

  5.   

    使用lblPstart.BackColor=Color.Transparent;可以让lable控件的背景色透明,可以看到摆放lable容器的背景色,但这个背景色不一定是窗体的背景色。
    比如:
    From1.Controls.Add(lable1);
    lable1.BackColor=Color.Transparent;
    这样,lable1就是透明的
    但是如果是:
    From1.Contorls.Add(pictureBox1);//或者是其它容器控件
    pictureBox1.Controls.Add(lable1);
    lable1.BackColor=Color.Transparent;
    那结果是lable1还是透明,但是看到的颜色是它的容器控件也就是pictureBox1的背景色,而不是窗体Form1的背景色。
    上面的代码可以在
    #region Windows 窗体设计器生成的代码
    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    方法中查看
      

  6.   

    在窗体的Load事件中加上这句代码试试看
    SetStyle(ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true);
    这么做是使窗体可以使用透明色。
    在窗体的Load事件中加上这句代码试试看
    SetStyle(ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true);
    这么做是使窗体可以使用透明色。
    在窗体的Load事件中加上这句代码试试看
    SetStyle(ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true);
    这么做是使窗体可以使用透明色。
    在窗体的Load事件中加上这句代码试试看
    SetStyle(ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true);
    这么做是使窗体可以使用透明色。
    在窗体的Load事件中加上这句代码试试看
    SetStyle(ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true);
    这么做是使窗体可以使用透明色。
      

  7.   

    我是放在一个Panel控件上的,这个控件是用来绘图的,但是不能透明。
      

  8.   

    我说的不能透明指得是label后面还有四方的灰色背景,楼上的兄弟们提供的方法等下实验
      

  9.   

    1.<asp:label Id="label1" BackColor="Transparent">
    2.this.label1.BackColor = System.Drawing.Color.Transparent;
    3.在窗体的Load事件中加上这句代码试试看
    SetStyle(ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true);
      

  10.   

    silverseven7() ( ) 
    在窗体的Load事件中加上这句代码试试看
    SetStyle(ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true);
    这么做是使窗体可以使用透明色。
    --------------
    不行,不行,不行,不行,不行,不行,不行,不行,不行,不行,
      

  11.   

    有没有写在:
    InitializeComponent()里.
      

  12.   

    public class myLabel : Label
    {
      protected override void InitLayout()
      {
       base.InitLayout ();
       SetLabelTransparence();
      }
      private void SetLabelTransparence()
      {    
       System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();
       path.AddString(this.Text,
        this.Font.FontFamily,
        (int)(FontStyle.Bold),
        this.Font.Size,
        new Point(this.ClientRectangle.Left,this.ClientRectangle.Top),
        new StringFormat());
       this.BackColor = this.ForeColor;
       this.Region = new Region(path);
      }
    }
      

  13.   

    最好还是用GDI+绘制,label不可能透明,因为label也是绘制的,只是它是直接绘制在背景上。所以背景和文字无法分离开。最好就是直接在panel上绘制。
      

  14.   

    如果你只是想要显示一些动态文字,你可以用picturebox代替,将picturebox设成透明
      

  15.   

    private void label1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
    {
    this.label1.BackColor = Color.Transparent;
    this.pictureBox1.Controls.Add(this.label1);
    }
    测试过没问题
      

  16.   

    把label的backColor的属性改成web中的Transparent。
    我就是这么弄的