Delphi以其優秀的界面和簡單的用法深受廣大程序員的喜愛
一. 方案
自做一個父類為TEdit的控件
二. 制作控件
啟動New Component
unit L_Edit;
interface
uses
Windows
Controls
StdCtrls;
type
L_TEdit
private
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
constructor Create(AOwner:TComponent); override;
procedure MoveShow;
published
{ Published declarations }
property Text;
end;
procedure Register;
implementation
constructor L_TEdit
begin
inherited create(aowner);
color:=clblue;
font
font
font
tabstop:=false;
update;
end;
procedure L_TEdit
var
edit_length
edit_char:char;
chars: string;
begin
chars:=
if (length(text)=
text:=
edit_length:=length(text);
for i:=
begin
edit_char:=text[
if (Ord(edit_char) >
if length(chars) >
begin
text:=copy(text
chars:=
end
else
begin
chars:=copy(text
text:=copy(text
end
else
begin
text:=copy(text
end;
update;
sleep(
end;
end;
procedure Register;
begin
RegisterComponents(
end;
end
再保存該文件
啟動Image Editor 創建L_Edit
三. 編寫主程序
在主窗體Form
unit L_Unit
interface
uses
Windows
Graphics
StdCtrls
type
Tmythread=class(TThread)
protected
procedure Execute; override;
end;
TForm
L_TEdit
Button
procedure FormCreate(Sender: TObject);
procedure Button
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form
From:http://tw.wingwit.com/Article/program/Delphi/201401/30262.html