Autor Beitrag
jjturbo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Di 18.12.07 14:43 
Moin Forum,

mit "GetStrProp" und "SetStrProp" kann ich auf Propertys einer sichtbaren Komponente wie z.B. "Caption" zugreifen.

Aber wie bekomme ich den Zusatnd einer boolschen Property abgefragt? Gibt es irgendwie so etwas wie GetBoolProp?

Danke im voraus, jjturbo

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Di 18.12.07 14:49 
???
ausblenden Delphi-Quelltext
1:
property Zustand: Boolean read GetZustand write SetZustand;					
:?:

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
hazard999
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 162

Win XP SP2
VS 2010 Ultimate, CC.Net, Unity, Pex, Moles, DevExpress eXpress App
BeitragVerfasst: Di 18.12.07 14:52 
Hallo,

probiers mal mit GetOrdVal.

Boolean ist ein Ordinal-Typ

r u

René

_________________
MOV EAX, Result;MOV BYTE PTR [EAX], $B9;MOV ECX, M.Data;MOV DWORD PTR [EAX+$1], ECX;MOV BYTE PTR [EAX+$5], $5A;MOV BYTE PTR [EAX+$6], $51;MOV BYTE PTR [EAX+$7], $52;MOV BYTE PTR [EAX+$8], $B9;MOV ECX, M.Code;MOV DWORD PTR [EAX+$9], ECX
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Di 18.12.07 14:55 
Ich möchte verschiedene propertys Abfragen, welche entscheidet sich erst während des Programmablaufs.
Ich habe aber eine Lösung gefunden:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
function GetBoolProperty(myPropertyName:String;Compo:TComponent):Variant;
var  p: PPropInfo;
begin
  p := GetPropInfo(Compo.ClassInfo, myPropertyName);
  if (p <> niland (p^.setProc <> nilthen begin
    Result := GetVariantProp(Compo, myPropertyName);
  end;
end;

procedure MeineProcedure(Sender: TObject);
bein
    if VarIsNull(GetBoolProperty(PropName,(Sender as TIrgendwas))
     then showmessage('ok')
     else showmessage('not ok');
end;

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...