[align=center]c# 的窗体可以设置Opacity属性 使窗体透明,结合timer 控件还可以实现渐变的效果。
Label 控件怎么实现这个效果? 求解!!![/align]

解决方案 »

  1.   

    Label 不是还简单些么?控制Label 的ForeColor不就可以了
      

  2.   

    for (int i = 0; i < 255; i++)
        label1.ForeColor = new Color(i, i, i);
      

  3.   

    for (int i = 0; i < 255; i++)
    {
      label1.ForeColor = new Color(i, i, i);
      Application.DoEvents();
      Thread.Sleep(100);
    }
      

  4.   

    把lable的backColor设为(0,0,0,0)这样就不用管lable了颜色就和你Form一样了,如果一定要lable的颜色也可!把lable重绘一下!
      

  5.   

           private void Form3_Load(object sender, EventArgs e)
                Thread th = new Thread(new ThreadStart(NewMethod));
                th.IsBackground = true;
                th.Start();
            }        private void NewMethod()
            {
                Control.CheckForIllegalCrossThreadCalls = false;
                for (int i = 0; i < 255; i++)
                {
                    label1.ForeColor = Color.FromArgb(i, i, i);                Thread.Sleep(100);
                }
            }
    不知道为什么 三楼的方法  我的Color没有三个参数的重载
    还有进程问题   
    你那个方法中不能实现渐变  而是直接改变颜色   
      

  6.   

    发个刷子你自己刷刷看
    using (LinearGradientBrush brush = new LinearGradientBrush(e.CellBounds, Color.LightGray,                                                             
                        Color.White, LinearGradientMode.Vertical))
                    {
                        e.Graphics.FillRectangle(brush, e.CellBounds);
                        Rectangle border = e.CellBounds;
                        border.Offset(new Point(-1, -1));
                        e.Graphics.DrawRectangle(Pens.Gray, border);
                    }
                    e.PaintContent(e.CellBounds);
                    e.Handled = true;
    在OnPaint事件下好像是!你看看
      

  7.   

    for(int i=0;i<100;i++){Label.BackColor = Color.FromArgb(i, 0, 0, 0);}
      

  8.   

    加一个Timer,通过Timer控制前景色