AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein GUI-Design mit VCL / FireMonkey / Common Controls Delphi Warum ist diese TGraphicControl nicht zu sehen?
Thema durchsuchen
Ansicht
Themen-Optionen

Warum ist diese TGraphicControl nicht zu sehen?

Ein Thema von berens · begonnen am 8. Nov 2005 · letzter Beitrag vom 8. Nov 2005
 
berens

Registriert seit: 3. Sep 2004
441 Beiträge
 
Delphi 10.4 Sydney
 
#1

Warum ist diese TGraphicControl nicht zu sehen?

  Alt 8. Nov 2005, 14:39
Man ersetze TGraphicControl durch TWinControl und es funktioniert. Warum nicht mit TGraphicControl?

Warum ist diese TGraphicControl nicht zu sehen?

Delphi-Quellcode:
type Tblabla= class(TGraphicControl)
  private
  public
    constructor Create(aOwner: TComponent); override;
  end;

implementation

constructor Tblabla.Create(aOwner: TComponent);
begin
  inherited Create(aOwner);
  if aOwner is TWinControl then begin
    Parent := (aOwner as TWinControl);
  end;
  ControlStyle := [csClickEvents,csCaptureMouse];
  Left := 10;
  Top := 10;
  Height := 100;
  Width := 100;
  ParentColor := false;
  Visible := true;
  with tlabel.Create(aowner) do begin
    left := 5;
    top := 5;
    width := 2000;
    height := 20000;
    color := clred;
    AutoSize := false;
    parent := (aowner as twincontrol);
    caption := 'XXXXXXXXXXXXXXXXXXXXXXXXXXX';
    BringToFront;
  end;
// Align := alClient;

  Color := clYellow;

  Self.Parent := aowner as TWinControl;


  Self.Show;

  Canvas.Lock;
  canvas.Brush.Color := cllime;
  Canvas.FillRect(rect(10,10,10,10));
  canvas.Unlock;
  Paint;

  Refresh;
  update;
  BringToFront;
  Repaint;
  Invalidate;
  Self.Parent := aowner as TWinControl;
end;

--------------------------------------------------------
Unit1:
procedure TForm1.FormCreate(Sender: TObject);
begin
  n := Tblabla.Create(Self);
  n.Parent := Self;
end;
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 19:42 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz