unit string_panel;
{$MODE Delphi}
interfaceuses
LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls,StdCtrls;type
Tstring_panel = class(TPanel)
private
{ Private declarations }
protected
{ Protected declarations }
public
Constructor Create(AOwner:TComponent);override;
Procedure textred(Sender:TObject);
procedure textwhite(Sender:TObject);
procedure import_string(import_string:string);
procedure export_string(var export_string:string);
Destructor Destroy;override;
{ Public declarations }
published
StringEdit1:TEdit;
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Dalton', [Tstring_panel]);
end;
Constructor Tstring_panel.Create;
begin
inherited create(AOwner);
Alignment:=taLeftJustify;
Height:=29;
Width:=325;
Font.Style:=[fsBold];
Font.Color:=clwhite;
Color:=clBlue;
stringEdit1:=TEdit.Create(stringEdit1);
with stringEdit1 do begin
Left:=85;
Width:=233;
Parent:=self;
font.Color:=clblack;
Text:='';
Top:=3;
OnEnter:=textred;
OnExit:=textwhite;
end;{ends with stringedit1}
end;
Destructor Tstring_panel.Destroy;
begin
stringEdit1.Destroy;
inherited destroy;end;{ends destructor destroy}
procedure Tstring_panel.textred;
begin
with Sender as TObject do begin
stringEdit1.Color:=clred;
stringEdit1.Font.Color:=clwhite;
end;
end;
procedure Tstring_panel.textwhite;
begin
with Sender as TObject do begin
stringEdit1.Color:=clwhite;
stringEdit1.Font.Color:=clblack;
end;
end;
procedure TSTring_panel.import_string;
begin
stringEdit1.Text:=import_string;
end;{ends import_string}procedure Tstring_panel.export_string;
begin
export_string:=stringEdit1.Text;
end;{ends export string}
end. That is a custom component I have used for years on several applications. There apparently is a resizing happening on my laptop, because width is set at 325, but when I put on on a tform, it is resizing to 975. The problem is that the stringEdit1 doesnt resize, so it is actually smaller in relation to the tpanel, and the stringedit1.left doesnt resize either, so it moves everything to the left. Help, please. This is on a laptop with a 17" screen. It doesnt resize on my desktop.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20250729/e2e9054f/attachment.htm>
