用透明窗体及透明Label做时间显示 想做一个计时器,让窗体透明,无标题栏,Label也透明...但是显示出来数字是乱的不能正常显示...把Label改成不透明后就可以了. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 事实是把窗体改成不透明或者是Label改成不透明的就可以. 我想到了一个办法应该可以实现就是全部采用动态创建控件的方法来完成首先动态创建一个窗体,再创建一个时钟控件,再创建两个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;我写了上面这段代码基本可以实际全透明显示,但还不完美.有时候还是会显示滞后和有闪烁现象...希望有高手能完善.... 希望楼上jxbw197408能否共享一下完整的代码,运行好像有问题。 自已定义一个var temp:TLabel; pemp:Tfrom;再引用 COMOBJ就可以运行啊..但是上面代码不完美..我搞不定了的. 哦,还要定义一个变量tp:integer; Tmemo里搜索指定的信息 如何在一个模态窗口中实现托盘程序? 请问如何获得文件大小和修改时间的方法!我现在的方法速度很慢!请大侠们帮忙! 请看我的数据库恢复代码,错在哪?总是提示‘需要独占数据库才可......’ 李维今天在成都签名售书 WebService导入数据类型问题,求教!!~ 就是隐藏不了qq的登陆窗口,有哪位高手请赐教,在下感激不进 高分求助 当我试图打开某个窗体时delphi自动关闭!请问为什么??? ADO连库 delphi QR报表问题,欢迎大家讨论 请问如何将qrdbtext 内容在QRBand1beforePrint赋给image1.canvas.textout
就是全部采用动态创建控件的方法来完成
首先动态创建一个窗体,再创建一个时钟控件,再创建两个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;
我写了上面这段代码基本可以实际全透明显示,但还不完美.有时候还是会显示滞后和有闪烁现象...希望有高手能完善....
temp:TLabel;
pemp:Tfrom;
再引用 COMOBJ就可以运行啊..但是上面代码不完美..我搞不定了的.
tp:integer;