var MonPicker : TDateTimePicker; ---- --- MonPicker := TDateTimePicker.Create(self); with MonPicker do begin Parent := MonFrame; Color := clBlue; end;
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls, ExtCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Déclarations privées } public { Déclarations publiques } end; var Form1: TForm1; PageControl1: TPageControl; TabSheet1: TTabSheet; Cadre: Tpanel; MonFrame: TFrame; MonBouton: TButton; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin // PageControl PageControl1 := TPageControl.Create(self); with PageControl1 do begin parent := Form1; Align := alnone; end; // Onglet TabSheet1 := TTabSheet.Create(self); with TabSheet1 do begin PageControl := PageControl1; PageControl.ActivePage := tabsheet1; tabsheet1.Caption := 'Onglet1'; end; // Panel Cadre := TPanel.Create(self); with Cadre do begin Parent := TabSheet1; BevelInner := bvLowered; BevelOuter := bvSpace; BevelWidth := 5; Cadre.Align := alClient; end; // Bouton MonBouton := TButton.Create(self); with MonBouton do begin Parent := TabSheet1; Top := 30; left := 200; width := 40; height := 20; Caption := 'test'; end; // Frame MonFrame := TFrame.Create(self); with MonFrame do begin Parent := TabSheet1; Color := Clyellow; width := 150; height := 150; end; end; end.
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question