大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 技术开发 -> 程序开发 -> 一个可以靠右显示的简单Edit控件

一个可以靠右显示的简单Edit控件

时间: 2021-07-31 作者:daque

unit redit;interfaceuses  windows, messages, sysutils, classes, graphics, controls, forms, dialogs,  stdctrls;type  tcustomredit = class(tcustomedit)  private    { private declarations }    falignment:talignment;    procedure setalignment(value: talignment);  protected    { protected declarations }    property alignment: talignment read falignment write setalignment default taleftjustify;    procedure createparams(var params: tcreateparams); override;  public    { public declarations }  published    { published declarations }  end;  tredit = class(tcustomredit)  published    { published declarations }    property alignment;    property anchors;    property autoselect;    property autosize;    property bidimode;    property borderstyle;    property charcase;    property color;    property constraints;    property ctl3d;    property dragcursor;    property dragkind;    property dragmode;    property enabled;    property font;    property hideselection;    property imemode;    property imename;    property maxlength;    property oemconvert;    property parentbidimode;    property parentcolor;    property parentctl3d;    property parentfont;    property parentshowhint;    property passwordchar;    property popupmenu;    property readonly;    property showhint;    property taborder;    property tabstop;    property text;    property visible;    property onchange;    property onclick;    property oncontextpopup;    property ondblclick;    property ondragdrop;    property ondragover;    property onenddock;    property onenddrag;    property onenter;    property onexit;    property onkeydown;    property onkeypress;    property onkeyup;    property onmousedown;    property onmousemove;    property onmouseup;    property onstartdock;    property onstartdrag;  end;procedure register;implementationprocedure tcustomredit.createparams(var params: tcreateparams);const  alignments: array[boolean, talignment] of dword =    ((es_left, es_right, es_center),(es_right, es_left, es_center));begin  inherited createparams(params);  with params do  begin    style := style or alignments[userighttoleftalignment, falignment];  end;end;procedure tcustomredit.setalignment(value:talignment);begin  if falignment <> value then  begin    falignment := value;    recreatewnd;  end;end;procedure register;begin  registercomponents('samples', [tredit]);end;end.上述不过给入门delphi控件创造者一点参考,固然不入方家法眼。不及之处,敬请教正。

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.