Delphi动态改变VCL对象的颜色和字体.rar

时间:2022-07-30 12:37:24
【文件属性】:
文件名称:Delphi动态改变VCL对象的颜色和字体.rar
文件大小:7KB
文件格式:RAR
更新时间:2022-07-30 12:37:24
Delphi源码-界面编程 Delphi动态改变VCL对象的颜色和字体,实现的功能有:储存对象、改变颜色、改变字体。在应用程序运行时动态改变VCL对象,而且改变的VCL对象可使用VCL Framework的Persistent功能保存等。通过改变字体颜色和字体样式来演示这些功能的实现。实现此三功能,代码如下:   储存对象操作:   procedure TForm1.Button1Click(Sender: TObject);   begin    mss.Clear;    mss.WriteComponent(Edit2);   end;   改变字体颜色操作:   procedure TForm1.Button2Click(Sender: TObject);   begin    if (Self.ColorDialog1.Execute) then    Edit2.Color := Self.ColorDialog1.Color;   end;   改变字体操作:   procedure TForm1.Button3Click(Sender: TObject);   begin    if (Self.FontDialog1.Execute) then    Edit2.Font := Self.FontDialog1.Font;   end;
【文件预览】:
srcfans.com
----CustomizedComponents()
--------fmDemoMain.dfm(2KB)
--------PCustomizedComponent.res(876B)
--------PCustomizedComponent.dof(2KB)
--------PCustomizedComponent.dpr(210B)
--------CustomizedComponents.cks(214B)
--------fmDemoMain.dcu(6KB)
--------fmDemoMain.pas(2KB)
--------fmDemoMain.ddp(51B)
--------PCustomizedComponent.cfg(434B)

网友评论