1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62:
| unit main;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, MyComponent, StdCtrls;
type TForm1 = class(TForm) Panel1: TPanel; Button1: TButton; MyComponent1: TMyComponent; procedure Button1Click(Sender: TObject); private public end;
var Form1: TForm1;
FLabel: TLabel; FFlowPanel : TFlowPanel; FPanel: TPanel;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject); begin FFlowPanel := TFlowPanel.Create(Panel1); FFlowPanel.Parent := Panel1 ; FFlowPanel.Top := 0; FFlowPanel.Left := 0; FFlowPanel.AutoSize := true; FFlowPanel.Visible := true; FFlowPanel.ParentBackground := false; FFlowPanel.ParentColor := false; FFlowPanel.Color := clRed; FFlowPanel.FlowStyle := fsLeftRightTopBottom;
FLabel := TLabel.Create(FFlowPanel); FLabel.Parent := FFlowPanel; FLabel.Top := 10; FLabel.Left := 10; FLabel.Transparent := false; FLabel.Color := clYellow; FLabel.Caption := 'test';
FPanel := TPanel.Create(FFlowPanel); FPanel.Parent := FFlowPanel; FPanel.Width := 10; FPanel.Height := 50; FPanel.ParentBackground := false; FPanel.Color := clBlue; end;
end. |