AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Problem mit Properties

Ein Thema von sundance · begonnen am 17. Jul 2006 · letzter Beitrag vom 17. Jul 2006
 
Hawkeye219

Registriert seit: 18. Feb 2006
Ort: Stolberg
2.227 Beiträge
 
Delphi 2010 Professional
 
#4

Re: Problem mit Properties

  Alt 17. Jul 2006, 12:56
Du könntest die index-Direktive nutzen:

Delphi-Quellcode:
type
  TForm1 = class (TForm)
    :
    procedure FormCreate (Sender: TObject);
  private
    Panels : array [1..4] of TPanel;
    function GetAppname (aIndex: Integer): String;
  public
    property App1Pathname: string index 1 read GetAppname;
    property App2Pathname: string index 2 read GetAppname;
    property App3Pathname: string index 3 read GetAppname;
    property App4Pathname: string index 4 read GetAppname;
  end;

procedure TForm1.FormCreate (Sender: TObject);
begin
  Panels[1] := Panel1;
  Panels[2] := Panel2;
  Panels[3] := Panel3;
  Panels[4] := Panel4;
end;

function TForm1.GetAppname (aIndex: Integer): String;
begin
  Result := Panels[aIndex].Caption;
end;
Ungetestet, aber so oder ähnlich sollte es funktionieren. Sicherheitsabfragen mußt du natürlich noch einbauen.

Gruß Hawkeye
  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 20:09 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