![]() |
Auf einer manuell erstellen Form wird nichts angezeigt
Hallo,
ich erstelle eine Form innerhalb einer Komponente manuell. Ein Button, welchen ich darauf erstelle wird problemlos angezeit, aber weder ein Memo, noch ein StaticText oder Tlabel. Hier der Quellcode:
Code:
Ich möchte auf dieser Form einfach nur einen längeren Text (Info) anzeigen.
unit ProgInfo;
interface uses Forms, Classes, StdCtrls; type TFormInfo = class(TForm) private btn_ok: TButton; text_info : TLabel; procedure btn_okClick(Sender: TObject); public constructor create(AOwner : TComponent); procedure anzeigen; end; implementation constructor TFormInfo.create(AOwner : TComponent); begin inherited CreateNew(AOwner); btn_ok := TButton.Create(self); // self ist die 'eigene Adresse' btn_ok.Left := 192; btn_ok.Top := 471; btn_ok.Width := 49; btn_ok.caption := 'OK'; btn_ok.parent := self; btn_ok.OnClick := btn_okClick; // Zuweisung der Ereignisbehandlung; text_info := Tlabel.Create(self); text_info.Top := 0; text_info.Left := 0; text_info.Height := 465; text_info.Width := 449; text_info.Visible := true; text_info.Caption := 'Info!'; end; procedure TFormInfo.btn_okClick(Sender: TObject); begin close; end; procedure TFormInfo.anzeigen; begin text_info.Caption := 'Es sind neue Einstellungen hinzugekommen:'; end; end. Da das ganze in einer Komponente statt findet, baue ich dazu kein dfm. Gruss mc |
AW: Auf einer manuell erstellen Form wird nichts angezeigt
Du hast vergessen, den Parent Deines Labels zu setzen.
|
AW: Auf einer manuell erstellen Form wird nichts angezeigt
aaaaahhhh :shock:
vielen Dank! Gruss mc |
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:19 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