Autor |
Beitrag |
allshoot
      
Beiträge: 22
d5 standart
|
Verfasst: So 19.02.06 14:45
Hallo Leute,
Ich habe ein Radiobutton und möchte überprüfen, ob etwas in .Caption drinsteht (Text oder Zahl) und wenn ja, dann diesen RadioButton auf .Visible:= true stellen.
Die Funktion IsCharAlpha funktioniert nicht.
Habt ihr ne Idee, wie ich das noch bewerkstelligen könnte?
THX im Voraus
allshoot
|
|
Marco D.
      
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: So 19.02.06 14:55
Ich muss dich falsch verstande haben
Meinst du so?
Delphi-Quelltext 1:
| if radiobutton1.caption<>'' then radiobutton1.enabled:=true; |
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
allshoot 
      
Beiträge: 22
d5 standart
|
Verfasst: So 19.02.06 15:03
Hi, ich hatte es mit IsCharAlpha so probiert:
Delphi-Quelltext 1: 2: 3: 4:
| with Fragen[i].A1 do begin Left:=112; Top:=290; Width:=601; Height:=41; visible:=(IsCharAlpha(Frgen[i].Ai.Caption)); end; |
Damit sollte dann visible auf true gesetzt werden, wenn in Caption was drinsteht.
allshoot
Moderiert von Christian S.: Code- durch Delphi-Tags ersetzt
|
|
Marco D.
      
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: So 19.02.06 15:06
Was ist mit meiner Variante, geht die?
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
allshoot 
      
Beiträge: 22
d5 standart
|
Verfasst: So 19.02.06 15:13
Hi, nee, denn in .Caption steht normalerweise ein String drin.
Wenn ich dann so probiere:
Delphi-Quelltext 1: 2: 3: 4:
| with Fragen[i].A1 do begin Left:=112; Top:=290; Width:=601; Height:=41; visible:=(IsCharAlpha(Fragen[i].Ai.Caption[1])); end; |
dann gibt es ein Error aus, wenn garnichts drinsteht.
allshoot
Moderiert von Christian S.: Code- durch Delphi-Tags ersetzt
|
|
Marco D.
      
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: So 19.02.06 15:17
allshoot hat folgendes geschrieben: | ob etwas in .Caption drinsteht |
Und genau das überprüfst du mit der if-Abfrage im zweiten Posting 
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
allshoot 
      
Beiträge: 22
d5 standart
|
Verfasst: So 19.02.06 15:21
Danke Koller, so hat es gefunzt!
THX!
allshoot
|
|
Marco D.
      
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: So 19.02.06 15:24
allshoot hat folgendes geschrieben: | Danke Koller, so hat es gefunzt!
THX!
allshoot |
Ich versteh nur nicht warum du das nicht gleich ausprobiert hast 
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
allshoot 
      
Beiträge: 22
d5 standart
|
Verfasst: So 19.02.06 15:54
Weil ich ein gaaaaanz neuer bin beim Programmieren
allshoot
|
|