N
nutian
Unregistered / Unconfirmed
GUEST, unregistred user!
几句代码就搞定了:
uses
ComCtrls, CommCtrl;
TIpEdit = class(TEdit)
procedure CreateParams(var Params: TCreateParams); override;
end;
{ TIpEdit }
procedure TIpEdit.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
InitCommonControl(ICC_INTERNET_CLASSES);
CreateSubClass(Params, WC_IPADDRESS);
end;
够简单, 该有的都有了。[]
来自:smilboy, 时间:2002-2-3 15:52:00, ID:904104
按照楼上的方法
unit IPAddressEdit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,ComCtrls, CommCtrl,
StdCtrls;
type
TIPAddressEdit = class(TEdit)
private
{ Private declarations }
protected
procedure CreateParams(var Params: TCreateParams); override;
public
{ Public declarations }
published
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Liren.z', [TIPAddressEdit]);
end;
{ TIPAddressEdit }
procedure TIPAddressEdit.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
InitCommonControl(ICC_INTERNET_CLASSES);
CreateSubClass(Params, WC_IPADDRESS);
end;
end.
=============================================================================
动态创建个Edit怎么样?试试下面代码:
uses
..., CommCtrl, ComCtrls;
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
InitCommonControl(ICC_INTERNET_CLASSES);
CreateWindow(WC_IPADDRESS,nil,WS_CHILD or WS_VISIBLE,20,20,130,23, Handle,0,
hInstance,nil);
end;
uses
ComCtrls, CommCtrl;
TIpEdit = class(TEdit)
procedure CreateParams(var Params: TCreateParams); override;
end;
{ TIpEdit }
procedure TIpEdit.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
InitCommonControl(ICC_INTERNET_CLASSES);
CreateSubClass(Params, WC_IPADDRESS);
end;
够简单, 该有的都有了。[]
来自:smilboy, 时间:2002-2-3 15:52:00, ID:904104
按照楼上的方法
unit IPAddressEdit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,ComCtrls, CommCtrl,
StdCtrls;
type
TIPAddressEdit = class(TEdit)
private
{ Private declarations }
protected
procedure CreateParams(var Params: TCreateParams); override;
public
{ Public declarations }
published
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Liren.z', [TIPAddressEdit]);
end;
{ TIPAddressEdit }
procedure TIPAddressEdit.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
InitCommonControl(ICC_INTERNET_CLASSES);
CreateSubClass(Params, WC_IPADDRESS);
end;
end.
=============================================================================
动态创建个Edit怎么样?试试下面代码:
uses
..., CommCtrl, ComCtrls;
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
InitCommonControl(ICC_INTERNET_CLASSES);
CreateWindow(WC_IPADDRESS,nil,WS_CHILD or WS_VISIBLE,20,20,130,23, Handle,0,
hInstance,nil);
end;