Einzelnen Beitrag anzeigen

Benutzerbild von mschaefer
mschaefer

Registriert seit: 4. Feb 2003
Ort: Hannover
2.029 Beiträge
 
Delphi XE3 Enterprise
 
#10

Re: dynamischer TStatictext liegt immer vor anderen Controls

  Alt 29. Jun 2005, 21:47
Moin, Spätmoin,

ok hört sich so an als ob die je nach Status Deines Programmes mal sichtbar und mal unsichtbar sein sollen.
Dafür gibt es trivial die Eigenschaft visible. Nun ist es natürlich einfacher ein Panel alle sichtbaren
Kontrols erschlagen zu lassen, finde ich aber irgendwie mit dem Hammer...

Würde das so machen:

Delphi-Quellcode:
           
        procedure DoSomething_WithControls
        ( Control : TControl );
        const Restricted : TColor = $00F8BFA7;
        begin
              If Control is TStaticText then
              begin
                 ( Control as TStaticText ).

        {                                                      }
        {                                                      }

       
        procedure DoSomething_WithControls
        ( Control : TControl );
        const Restricted : TColor = $00F8BFA7;
        begin
              If Control is TStaticText then
              begin
                 with ( Control as TStaticText ) do
                 begin
                 if visible = true
                 then visible := false
                 else visible := true
                 end;
              end;
        end;


        {                                                      }
        {                                                      }


        procedure RecursePanels
        ( StarPanel : TPanel );
        var tmpPanel : TPanel;
                   i : Integer;
        begin
             for i := 0 to StarPanel.ControlCount-1 do
             begin
                  if StarPanel.Controls[i] is TPanel then
                  begin
                     tmpPanel := ( StarPanel.Controls[i] as TPanel );
                     RecursePanels ( tmpPanel );
                  end else
                  begin
                     DoSomething_WithControls( StarPanel.Controls[i] );
                  end;
             end;
        end;

begin
          RecursePanels( CR_Panel_ClientAreaBasis );
end;
Gute Nacht // Martin
Martin Schaefer
  Mit Zitat antworten Zitat