AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein GUI-Design mit VCL / FireMonkey / Common Controls Delphi Anzahl Formulare / Dynamisch Klassen ansprechen?
Thema durchsuchen
Ansicht
Themen-Optionen

Anzahl Formulare / Dynamisch Klassen ansprechen?

Ein Thema von miLeRiAm · begonnen am 31. Okt 2008 · letzter Beitrag vom 31. Okt 2008
 
miLeRiAm

Registriert seit: 3. Sep 2004
Ort: :/root
34 Beiträge
 
RAD-Studio 2009 Pro
 
#10

Re: Anzahl Formulare in der Applikation

  Alt 31. Okt 2008, 11:10
Zitat von Frankfurtoder:
Formatieren hilft Der Code mit den If's sieht ja grausam aus.
Delphi-Quellcode:
 if handleList.Count = 0 then
 begin

  frmMain.handleList.Clear;

  for j := 0 to screen.FormCount-1 do
  begin

   for i := 0 to screen.Forms[j].ComponentCount-1 do
   begin
    screen.Forms[j].Components[i].Tag := ((j+1) * 10000) + i;
   end;

   for i := 0 to screen.Forms[j].ComponentCount-1 do
   begin

    comp := screen.Forms[j].Components[i];

    if (comp is TButton) or (comp is TToolButton) or (comp is TLabel) or (comp is TMenuItem) or
       (comp is TCheckBox) or (comp is TRadioButton) or (comp is TTabSheet) or (comp is TSpeedButton)
    then
     begin

      if comp is TButton then handleList.Add(IntToStr(comp.Tag)+'='+TButton(comp).Caption);
      if comp is TToolButton then handleList.Add(IntToStr(comp.Tag)+'='+TToolButton(comp).Caption);
      if comp is TLabel then handleList.Add(IntToStr(comp.Tag)+'='+TLabel(comp).Caption);
      if comp is TMenuItem then handleList.Add(IntToStr(comp.Tag)+'='+TMenuItem(comp).Caption);
      if comp is TCheckBox then handleList.Add(IntToStr(comp.Tag)+'='+TCheckBox(comp).Caption);
      if comp is TRadioButton then handleList.Add(IntToStr(comp.Tag)+'='+TRadioButton(comp).Caption);
      if comp is TTabSheet then handleList.Add(IntToStr(comp.Tag)+'='+TTabSheet(comp).Caption);
      if comp is TSpeedButton then handleList.Add(IntToStr(comp.Tag)+'='+TSpeedButton(comp).Caption);

     end;

   end;

  end;

 end;

Habe ich grade
Wurde langsam wirklich unübersichtlich.

Gefallen tut mir die Lösung aber dennoch nicht.

Stichwort: Mehrsprachigkeit.
  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 23:06 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