Einzelnen Beitrag anzeigen

Robert_G
(Gast)

n/a Beiträge
 
#9

Re: Auf die Eigenschaften eines Forms zugreifen

  Alt 13. Jan 2005, 12:22
  1. Code:
    SomeForm someForm = new SomeForm();
  2. Code:
    class MainForm :Form
       SomeForm dialog;
     
       public SomeForm Dialog
       {
          get{ return dialog;}
       }

       public MainForm()
       {
          dialog= new SomeForm();
       }
    }
  1. Delphi-Quellcode:
    var
       SomeForm :TSomeForm;
    begin
       SomeForm = TSomeForm.Create();
  2. Delphi-Quellcode:
    type TMainForm = class(Form)
       private fDialog :TSomeForm;
       published property Dialog :TSomeForm read fDialog;
       public constructor Create()
    end;
    implementation

    constructor TMainForm.Create()
    begin
       fDialog := TSomeForm,Create();
    end;
  Mit Zitat antworten Zitat