Hello lazarus project!

How to assure, that all nested components will be repainted after
calling MyPanel.Paint, because actually all components are behind new
rectangle.

procedure TMyPanel.Paint;
var rect :TRect;
begin
  rect := GetClientRect;
  InflateRect(rect,-50,-50);
  Canvas.Brush.Color:= clYellow;
  Canvas.Rectangle(rect);

  inherited Paint;
end;

procedure TForm1.FormCreate(Sender: TObject);
var mp:TMyPanel;
begin
  mp := TMyPanel.Create (self);
  with mp do begin
    Parent := self;
    Left := 0;
    Top := 0;
    Width := 200;
    Height := 150;
    Color:= clRed;
  end;
  
  with TRadioButton.Create(mp) do begin
    Left:= 10;
    Top := mp.Height div 2;
    Width:=150;
    Caption:= 'Roland';
    Parent := mp;
  end;
end;

Thanks in advance.

-- 
Best regards, TRoland
http://www.rotursoft.sk
http://exekutor.rotursoft.sk

_______________________________________________
Lazarus mailing list
[email protected]
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to