Autor Beitrag
peppi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 65


delphi 7
BeitragVerfasst: Fr 06.12.02 13:40 
Hallo ihr,

wie stell ich es an das ein Label erst dann sichtbar wird wenn eine DBText-Komponente einen Wert hat? habe über den Objekt-Inspektor dem Label die Eigenschaft Visible := False zugeordnet und dann hab ich's mit folgender IF-Anweisung versucht:

ausblenden Quelltext
1:
2:
3:
if DBText1.visible = true
then Label1.visible := true
else Label1.visible =: false;


Aber DBText1 ist ja eigentlich immer visible ... hat nur ab und zu keine Werte, und dann siehts man's logischweise auch nicht. Aber mein Label wird gleich sichtbar. Die Online-Hilfe is wiedermal überhaupt keine wirkliche Hilfe :evil:

Hoffe ihr wisst da was!

Danke schonmal!

Jana!
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Fr 06.12.02 13:52 
Hi
peppi hat folgendes geschrieben:

Die Online-Hilfe is wiedermal überhaupt keine wirkliche Hilfe

Eigentlich schon. Das Problem ist meist nur zu wissen, wonach man suchen muss. 8)

Zitat:

Aber DBText1 ist ja eigentlich immer visible ... hat nur ab und zu keine Werte

Gut erkannt. Also wirst du wohl irgendwie auf Änderung der Werte reagieren müssen. Und woher bekommen deine DBText-Elemente ihre Werte? Richtig! Von TDataSource. Und spätestens jetzt wird die Online-Hilfe wieder interessant. Das Stichwort heisst TDataSource.OnDataChange. Versuch mal ob du damit was anfangen kannst. Wenns gar nicht klappt, kannst du dich ja noch mal melden.

Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
a.C.k
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 93

WIN 2000
Delphi 6 Enterprise ; Delphi 7 Studio
BeitragVerfasst: Fr 06.12.02 16:49 
wie Du auch schon richtig erkannt hast, wird der DBText nicht Visible := False sondern hat nur keinen wert.
Versuche doch mal diesen Fall abzufragen.

Alo in etwa:
ausblenden Quelltext
1:
2:
If DBText1.Caption = '' then
...

_________________
Wer nicht gerne denkt, sollte wenigstens von Zeit zu Zeit seine Vorurteile neu gruppieren.