Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Formularvererbung aktualisieren (https://www.delphipraxis.net/110447-formularvererbung-aktualisieren.html)

Hansa 18. Mär 2008 16:48

Re: Formularvererbung aktualisieren
 
Liste der Anhänge anzeigen (Anzahl: 1)
Die Demo war schon mal gut. Nun denn. Ich habe das Formular "FormBase" einem neuen Formular als Vorfahr zugeordnet (über -> Objektablage). Hierbei ist es zwingend notwendig, die DFM und PAS synchron zu halten. Das ist anscheinend schwierig und wohl auch der Grund, warum kaum jemand das so benutzt. Der abgeleiteten Form habe ich noch einen Button spendiert. Heraus kommt dabei folgender Quelltext :

Delphi-Quellcode:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, form_base, StdCtrls, ExtCtrls;

type
  TformBase1 = class(TformBase)
    btn1: TButton;
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  formBase1: TformBase1;

implementation

{$R *.dfm}

end.
korrespondierende DFM :

Delphi-Quellcode:
inherited formBase1: TformBase1
  Caption = 'formBase1'
  OldCreateOrder = True
  PixelsPerInch = 96
  TextHeight = 13
  object btn1: TButton
    Left = 448
    Top = 240
    Width = 75
    Height = 25
    Caption = 'btn1'
    TabOrder = 2
  end
end
Kompletter wichtiger Source im Anhang.

Edit : Upload ging anscheinend nicht. Die DPR ist im Anhang. Erstes Code-Fragment muss gespeichert werden als Unit1.pas und das zweite als Unit1.dfm.


Alle Zeitangaben in WEZ +1. Es ist jetzt 17:01 Uhr.
Seite 2 von 2     12   

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