Autor Beitrag
hedie
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249

WIN XP WIN 2000 WIN Longhorn
D7 Pers D2005 Architect Vollversion
BeitragVerfasst: Fr 01.04.05 14:52 
Hallo

Gibt es eine möglichkeit, dass wenn man 1mal auf einen button klickt, das dan zumbeispiel ein panel blau wird und wenn man danach den selben button ein 2tes mal anklick, dass das panel dan zb wieder rot wird?

grüsse
hedie


Moderiert von user profile iconGausi: Topic aus Sonstiges verschoben am Fr 01.04.2005 um 15:58

_________________
Grüsse hedie
hört auf traurig zusein hört lieber radio Basilisk
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Fr 01.04.05 14:55 
Frag doch einfach ab, welche Farbe das Panel im Moment hat... ;)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.Button1Click(Sender: TObject);
begin
if Panel1.Color = clRed then Panel1.Color := clBlue else Panel1.Color := clRed;
end;
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 01.04.05 14:56 
du könntest dafür z.B. die Eigenschaft Tag des Buttons benutzen. Immer bei KLick setzt du die um von z.B 0 auf 1 und umgekehrt, und je nachdem, wie der Tag gerade ist, machst du das Panel blau oder grün.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
case TButton(Sender).Tag of
  0: begin
    //machwas;
    TButton(Sender).Tag:=1;
  end;
  1: begin
    //machwasanderes;
    TButton(Sender).Tag:=0;
  end;  
end;

_________________
We are, we were and will not be.
hedie Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249

WIN XP WIN 2000 WIN Longhorn
D7 Pers D2005 Architect Vollversion
BeitragVerfasst: Fr 01.04.05 14:57 
gute idee danke

_________________
Grüsse hedie
hört auf traurig zusein hört lieber radio Basilisk