Autor Beitrag
Hannah1990
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Do 07.09.06 15:48 
Hi !

Ich habe folgendes Problem :

Ich hab im Informatik eine Hausaufgabe bekommen, da sollen wir halt 2 Buttons machen und auf dem einen soll Tag und auf dem anderen Nacht stehen. Wenn man den Tagbutton drückt, soll der Hintergrund blau werden, und es soll ein Label erscheinen auf dem "Sonne" steht.
Bei Nacht eben der Hintergrund schwarz und ein "Mond"-Label.

Die Buttons und die Farbänderungen kireg ich ja noch hin, aber wie mach ich das mit den Labels.

Wär klasse, wenn mir jemand helfen könnte, wir haben kein Informatik-Buch und im Iinternet find ich nix...


Moderiert von user profile iconGausi: Topic aus Sonstiges (Delphi) verschoben am Do 07.09.2006 um 16:55
evilsoft.de
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 39

XP
Delphi 7
BeitragVerfasst: Do 07.09.06 15:52 
ausblenden Delphi-Quelltext
1:
Label1.Caption := 'Sonne';					
Hannah1990 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Do 07.09.06 16:02 
Nee, wie man dem Label n Namen gibt weiß ich, allerdings weiß ich nich, wie das geht, dass bei Klick auf den Tag Button das Label "Sonne" erscheint...
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: Do 07.09.06 16:04 
mit der visible eigentschaft des labels
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: Do 07.09.06 16:05 
Hallo und :welcome: in der Entwickler-Ecke!

Die Eigenschaft, die du suchst, dürfte visible sein:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
// anzeigen
Label1.Visible := True;
//verstecken
Label1.Visible := False;

_________________
We are, we were and will not be.
der Berliner
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 417

Win Xp Home
delphi 2005
BeitragVerfasst: Do 07.09.06 16:06 
hi
Im Objektinspektor Label.Sonne Visible=False setzen und dan in deinem Code von Button.Tag.Click
ausblenden Delphi-Quelltext
1:
Lable.Sonne.Visible:=True;					


Gruß

Edit: Wieder mal zu Spät. :?

_________________
[b]Ich weiß nicht immer, wovon ich rede. Aber ich weiß, dass ich recht habe.[b]
Hannah1990 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Do 07.09.06 16:25 
Sorry,dass ich euch nerve, aber ich verzweifle hier... Mein Unit-Text is jetzt so :

(also n ausschnitt)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm1.btnTagClick(Sender: TObject);
begin
form1.color := claqua
Label1.Visible := True;
end;

procedure TForm1.btnNachtClick(Sender: TObject);
begin
form1.color := clblack
Label2.Visible := True;
end;


Beim oBjektinspektor hab ich jeweils bei beiden Labels "visible" auf "false" gesetzt...

Es klappt aber nich...

Da kommt die Fehlermeldung, dass OPerator oder Semikolon fehlt....

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt
der Berliner
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 417

Win Xp Home
delphi 2005
BeitragVerfasst: Do 07.09.06 16:28 
mach mal hinter
ausblenden Delphi-Quelltext
1:
Form1.Color:=clAqua;					

nen semikolon und bei
ausblenden Delphi-Quelltext
1:
Form1.Color:=clBlack;					

auch.

wenn du Code Postest benutze mal die Delphi tags.
ist dan besser zu lesen :wink:
Gruß

_________________
[b]Ich weiß nicht immer, wovon ich rede. Aber ich weiß, dass ich recht habe.[b]
Hannah1990 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Do 07.09.06 16:51 
Danke Leute :)

Jetzt klappts und Ha´s sind schon aufm Weg zum Lehrer !