Autor Beitrag
-delphin-
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 200



BeitragVerfasst: Mi 15.06.05 05:59 
Hi, ich habe das Problem, dass mein Programm jede Menge Buttons und Labels besitzt, die sich im Laufe des Programms disabled werden. und ich einen "Renew"-Button machen will, der alles wieder zurücksetzt. Da ich aber wennmöglich wegen der Ästhetik des Programms um die Schreiberei der ganzen Button.Enabled:=true; rumkommen will, würde es mich interessieren, ob es einen Befehl gibt, der das Programm schließt und sofort wieder öffnet, oder irgendeine andere Möglichkeit, sehr viele Buttons zu enablen, ohne 20mal das selbe zu schreiben.
Thx im Vorraus
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mi 15.06.05 06:22 
Lauf doch alle Kontrols deiner Form durch. Wenn die Buttons Button1, Button2, ... heißen, einfach mit einer Schleife und Suche in: Delphi-Forum, Delphi-Library FINDCOMPONENT 'drüberlaufen'.
-delphin- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 200



BeitragVerfasst: Mi 15.06.05 16:05 
die buttons heißen aber relativ anders, was alle gleich im namen haben ist ein 'B' für Button^^
matze.de
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: Mi 15.06.05 17:16 
Dann seperier die doch mit der Tag eigenschaft:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
for i := 0 to Self.ComponentCount - 1 do begin
  if Self.Components[i] is TButton then begin
    if Self.Components[i].Tag = '123' then
      (Self.Components[i] as TButton).Visible := True;
  end;
end;


mfg matze

_________________
si tacuisses, philosophus mansisses.
-delphin- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 200



BeitragVerfasst: Mi 15.06.05 18:57 
Und wie sieht das aus, wenn die Buttons "BPl1Einser", "BPl2Einser", "BPl1Zweier", "BPl2Zweier" usw. heißen?