Autor Beitrag
ultraz06
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 84



BeitragVerfasst: Mi 28.01.09 16:09 
hi :)
ich habe folgendes problem ich will das wenn ich auf die rechte maustaste klicke eine gewisse anzahl von images wieder sichtbar werden.
ich lasse immer ein image verschwinden beim drücken der linken maustase beim
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure tform1.PaintBox1Click(Sender: TObject);
begin
munition ;
end;

so nun möchte ich das wenn die anzahl der sichtbaren images 0 ist per rechter maustaste alle wieder sichtbar machen
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
procedure tform1.munition;
begin

anz:=anz-1;

Image1.Visible := anz >= 5;
Image2.Visible := anz >= 4;
Image3.Visible := anz >= 3;
Image4.Visible := anz >= 2;
Image5.Visible := anz >= 1;
if anz=0 then if key = VK_RBUTTON then
begin
    Image1.Visible := true;
    Image2.Visible :=true;
    Image3.Visible := true ;
    Image4.Visible := true;
    Image5.Visible:=true;

nun weiß ich aber nicht in welche procedure ich das schreiben muss :/
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Mi 28.01.09 16:12 
In OnMouseDown vom Formular z.B.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  if Button = mbRight then
end;

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 28.01.09 16:13 
Setz dort einfach anz auf 6 und ruf munition auf. ;-)
ultraz06 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 84



BeitragVerfasst: Mi 28.01.09 16:15 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
if anz=0 then
if Button = mbRight then
begin
    Image1.Visible := true;
    Image2.Visible :=true;
    Image3.Visible := true ;
    Image4.Visible := true;
    Image5.Visible:=true;
end;

aber es geht trotzdem nicht...
ultraz06 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 84



BeitragVerfasst: Mi 28.01.09 16:16 
wo soll ich anz auf 6 setzen ?
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 28.01.09 16:19 
user profile iconultraz06 hat folgendes geschrieben Zum zitierten Posting springen:
aber es geht trotzdem nicht...
Was geht nicht? Was passiert? Was nicht? Hast du einen Haltepunkt gesetzt und geschaut was passiert?

user profile iconultraz06 hat folgendes geschrieben Zum zitierten Posting springen:
wo soll ich anz auf 6 setzen ?
Naja, nur dadurch, dass du die Bilder wieder sichtbar machst, funktioniert das ja nicht. Denn davon weiß dein Programmcode ja nix.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure tform1.munition;
begin

anz:=anz-1;

Image1.Visible := anz >= 5;
...
Dort prüfst du ja nicht, ob die Bilder sichtbar sind, sondern anz. Und das ist ja immer noch 0.