网页功能: 加入收藏 设为首页 网站搜索  
可以设置对齐方式的Edit组件
发表日期:2005-03-15作者:田耀增[原创] 出处:  

{**
 * 单元:FloatEdit
 * 作者:网事如风
 * 作用:可以设置对齐方式的Edit
 * 使用:
 **}
 
 unit RightEdit;
 
 interface
 
 uses
   Windows, Messages, SysUtils, Classes, Controls, StdCtrls;
 
 type
   TRightEdit = class(TEdit)
   private
     FAlignment   : TAlignment;      //对齐方式
     procedure SetAlignment(Value: TAlignment);
   protected
     procedure CreateParams(var Params: TCreateParams); override;
   public
     { Public declarations }
   published
     property Alignment: TAlignment read FAlignment write SetAlignment;
   end;
 
 procedure Register;
 
 implementation
 
 procedure Register;
 begin
     RegisterComponents('MyCompent', [TRightEdit]);
 end;
 
 
 procedure TRightEdit.CreateParams(var Params: TCreateParams);
 begin
     inherited CreateParams(Params);
     Case FAlignment of
         taLeftJustify  : Params.Style := Params.Style + ES_LEFT;
         taRightJustify : Params.Style := Params.Style + ES_RIGHT;
         taCenter       : Params.Style := Params.Style + ES_CENTER;
     end;
 end;
 
 procedure TRightEdit.SetAlignment(Value: TAlignment);
 begin
     if FAlignment <> Value then
     begin
         FAlignment := Value;
         RecreateWnd;
     end;
 end;
 end.

我来说两句】 【加入收藏】 【返加顶部】 【打印本页】 【关闭窗口
中搜索 可以设置对齐方式的Edit组件
本类热点文章
  DBGrid 应用全书
  DBGrid 应用全书
  TWebBrowser编程简述
  用户界面设计的技巧与技术
  用户界面设计的技巧与技术
  初探Delphi 7 中的插件编程
  获取主板BIOS的信息
  网卡的远程网络唤醒
  Delphi 2006简介(Dexter)
  用Delphi开发数据库程序经验三则
  Delphi面向对象编程的20条规则
  Delphi面向对象编程的20条规则
最新分类信息我要发布 
最新招聘信息

关于我们 / 合作推广 / 给我留言 / 版权举报 / 意见建议 / 广告投放  
Copyright ©2003-2024 Lihuasoft.net webmaster(at)lihuasoft.net
网站编程QQ群   京ICP备05001064号 页面生成时间:0.00459