我想在窗体上的标签能够闪烁,应该如何做到,请各位前辈相助,小弟在线等待!!

解决方案 »

  1.   

    放一个timer,在ontimer事件中,修改label的font.color属性
      

  2.   

    放一个TIMER控件,在事件下:
    begin
      if Label1.Font.color:=clRed then
        Label1.Font.Color:=clWhite
      else
        Label1.Font.Color:=clRed;
    end;
      

  3.   

    你想怎么闪法呢.加入一个timer控制....
    然后你想让他怎么闪都行了,就像" xzhifei(星级饭桶(抵制日货)·飞"所说的.
      

  4.   

    给你一个简单的,推荐用楼上的Timer方法:
    type
      TFlashLabel = class(TThread)
      private
        { Private declarations }
      protected
        procedure Execute; override;
      end;  TForm1 = class(TForm)
        Label1: TLabel;
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
        procedure FlashLabel;
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FlashLabel;
    begin
      Label1.Color := clLime;
      Label1.Repaint;
      Sleep(500);
      Label1.Color := clSkyBlue;
      Label1.Repaint;
      Sleep(500);
      Label1.Color := clLime;
      Label1.Repaint;
      Sleep(500);
      Label1.Color := clSkyBlue;
      Label1.Repaint;
      Sleep(500);
    end;procedure TForm1.Button1Click(Sender: TObject);
    begin
      TFlashLabel.Create(false);
    end;{ FlashLabel }procedure TFlashLabel.Execute;
    begin
      inherited;
      self.FreeOnTerminate := true;
      Form1.FlashLabel;
    end;
      

  5.   

    如果不想处理的过于复杂,一个timer就可以处理了
      

  6.   

    weizi2000(秋风啊)  你用sleep() 的办法会使软件和死机一样。只要改一下timer的间隔时间就行了。
      

  7.   

    1、最好不要用第三方控件,虽然也没有什么大碍,但有些时候很难缠。
    2、用TIMER实现最好了,但尽量不要用SLEEP(X),会降低程序效率。
      

  8.   

    nSCSI(摩洛客中文論壇):不会的,你再看看;我加它在一个单独的线程里,否则我也不用贴那么多了
      

  9.   

    可以在Timer下编程
    Procedure TForm1.Timer1Timer(sender:object)
    begin
      label1.visible:=not label1.visible;
    end;