Thema: Delphi kniffel - zahlenabfrage

Einzelnen Beitrag anzeigen

Noedel

Registriert seit: 7. Aug 2008
204 Beiträge
 
Delphi 7 Professional
 
#8

Re: kniffel - zahlenabfrage

  Alt 26. Mai 2010, 20:19
Zitat von Wolfgang Mix:
Ausserdem:

Delphi-Quellcode:
if w1 = 1 then //fragt ab und zeigt die bilder
Image1.Visible:=true;
if w1 = 2 then
Image2.Visible:=true;
if w1 = 3 then
Image3.Visible:=true;
if w1 = 4 then
Image4.Visible:=true;
if w1 = 5 then
Image5.Visible:=true;
if w1 = 6 then
Image6.Visible:=true;
wird übersichtlicher mit

Delphi-Quellcode:
case w1 of
  1: Image1.Visible:=true;
  2: Image2.Visible:=true;
  ...
end;
Dann können wir auch gleich
TImage(FindComponent('Image'+IntToStr(w1))).Visible:=true nehmen
-"Was studierst du eigentlich? Nerdologie?"
-"Informatik..."
-"Wusst ich´s doch!"
  Mit Zitat antworten Zitat