»áÔ±£º ÃÜÂ룺 ¡¡Ãâ·Ñ×¢²á | Íü¼ÇÃÜÂë | »áÔ±µÇ¼ ÍøÒ³¹¦ÄÜ£º ¼ÓÈëÊÕ²Ø ÉèΪÊ×Ò³ ÍøÕ¾ËÑË÷  
¼¼ÊõÎĵµ > Delphi
¿ÉÒÔÉèÖöÔÆ뷽ʽµÄEdit×é¼þ
·¢±íÈÕÆÚ£º2005-03-15 23:57:37×÷ÕߣºÌ ³ö´¦£º  

{**
 * µ¥Ôª£º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.

¡¾·µ»Ø¶¥²¿¡¿ ¡¾´òÓ¡±¾Ò³¡¿ ¡¾¹Ø±Õ´°¿Ú¡¿

¹ØÓÚÎÒÃÇ / ¸øÎÒÁôÑÔ / °æȨ¾Ù±¨ / Òâ¼û½¨Òé / ÍøÕ¾±à³ÌQQȺ   
Copyright ©2003- 2024 Lihuasoft.net webmaster(at)lihuasoft.net ¼ÓÔØʱ¼ä 0.00407