Arkadaşlar bunu odev olduğu icin yapmıştım. Download yapmamanız icin direk kodları verdim.
Bu Component edit eklendiğinde sol tarafa ya da uste otomatik bir Label Ekliyor. ve bu başlık değiştirilebiliyor.
Bunun icin ShowCaption ozelliğini True yapın ve baslik yazan yere başlığı yazın.
ustbaslik isimli yerdende başlığın nereye geleceğini ayarlayabilirsiniz.
unit LabelEDit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,stdctrls,dsgnintf;
type
TLabelEDit = class(TWinControl)
private
Fcapt:TLabel;
FText:Tedit;
protected
public
constructor create(owner:tcomponent);override;
destructor destroy;override;
published
property capt:Tlabel read FCapt write Fcapt;
property text:Tedit read Ftext write Ftext;
end;
Tlabeleditproperty = class (Tclassproperty);
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Benim', [TLabelEDit]);
registerpropertyeditor(Typeinfo(Tlabel),Tlabeledit ,'capt',Tlabeleditproperty);
registerpropertyeditor(Typeinfo(Tedit),Tlabeledit, 'text',Tlabeleditproperty);
end;
constructor TLabelEDit.create(owner: tcomponent);
begin
inherited;
fcapt:=tlabel.create(self);
with fcapt do
begin
align:=alleft;
alignment:=tarightjustify;
caption:='Label';
parent:=self;
end;
ftext:=tedit.create(self);
with ftext do
begin
left:=fcapt.width+5;
top:=0;
parent:=self;
end;
width:=fcapt.Width+ftext.Width+5;
height:=ftext.Top+ftext.height;
end;
destructor TLabelEDit.destroy;
begin
ftext.free;
fcapt.free;
inherited;
end;
end.
__________________
Guzel LabelEdit Componenti
Programlama0 Mesaj
●30 Görüntüleme
- ReadBull.net
- Programlama ve Yazılım
- Programlama
- Guzel LabelEdit Componenti