bodyguard
15 years agoOccasional Contributor
TC4 Focuscontrol
Hi, ALL
I have Delphi Form with the Label (TLabel) and Lookup (Created in runtime, name random).
I can find label by its caption, I can get object from TLabel.FocusControl.
Function FindParam3(OBJ, ACaption): OLEVaraint;
var I;
PropArray, ValuesArray;
begin
PropArray := CreateVariantArray(0, 0);
ValuesArray := CreateVariantArray(0, 0);
PropArray[0] := 'Caption';
ValuesArray[0] := ACaption;
I := obj.find(PropArray, ValuesArray, 1000);
if I.Exists then begin
Result := i.FocusControl;
end
else begin
Result := Null;
end;
end;
But this object has different interface that I can found from TC object browser.
I needed TestComplete method KEYS and other.
How to typecast FocusControl to TLookup?
Or how to I can get Focuscontrol.NativeDelphiobject.Name (Lookup.name)?
Or other way to get VCL Control with runtime name generation?
I have Delphi Form with the Label (TLabel) and Lookup (Created in runtime, name random).
I can find label by its caption, I can get object from TLabel.FocusControl.
Function FindParam3(OBJ, ACaption): OLEVaraint;
var I;
PropArray, ValuesArray;
begin
PropArray := CreateVariantArray(0, 0);
ValuesArray := CreateVariantArray(0, 0);
PropArray[0] := 'Caption';
ValuesArray[0] := ACaption;
I := obj.find(PropArray, ValuesArray, 1000);
if I.Exists then begin
Result := i.FocusControl;
end
else begin
Result := Null;
end;
end;
But this object has different interface that I can found from TC object browser.
I needed TestComplete method KEYS and other.
How to typecast FocusControl to TLookup?
Or how to I can get Focuscontrol.NativeDelphiobject.Name (Lookup.name)?
Or other way to get VCL Control with runtime name generation?