想做一个计时器,让窗体透明,无标题栏,Label也透明...
但是显示出来数字是乱的不能正常显示...把Label改成不透明后就可以了.

解决方案 »

  1.   

    事实是把窗体改成不透明或者是Label改成不透明的就可以.
      

  2.   

    我想到了一个办法应该可以实现
    就是全部采用动态创建控件的方法来完成
    首先动态创建一个窗体,再创建一个时钟控件,再创建两个Label,每秒换一次,理论上可以实现
    procedure TForm1.Timer1Timer(Sender: TObject);
    begin
     if Assigned(temp) then
         TEmp.Free;
     if Assigned(pemp) then
         Pemp.Free;
     pemp:=Tform.Create(self);
     pemp.Brush.Style :=bsClear;
     pemp.BorderStyle :=bsNone;
     pemp.Show; temp:=TLabel.Create(self);
     temp.Parent:=pemp;
     temp.Left :=50;
     Temp.Top :=70;
     temp.Height:=97;
     temp.Width:=105; temp.Caption:=IntTOStr(tp);
     if StrToInt(temp.Caption)<10 then
         temp.Caption:='0'+ IntTOStr(tp);
     temp.Font.Charset:=GB2312_CHARSET;
     temp.Font.Color:=clYellow;
     TEMP.Font.Name :='黑体';
     TEMP.Font.Size :=72;
     TEMP.Transparent:=True;
     temp.Show;
     tp:=tp+1;
    end;
    我写了上面这段代码基本可以实际全透明显示,但还不完美.有时候还是会显示滞后和有闪烁现象...希望有高手能完善....
      

  3.   

    希望楼上jxbw197408能否共享一下完整的代码,运行好像有问题。
      

  4.   

    自已定义一个var
     temp:TLabel;
     pemp:Tfrom;
    再引用 COMOBJ就可以运行啊..但是上面代码不完美..我搞不定了的.
      

  5.   

    哦,还要定义一个变量
    tp:integer;