delphi - DWScript set TFormStyle property on external TForm instance -


i try set properties on tform instance "injected" script using tdwsrtticonnector , funcion:

procedure tform1.onfunctioneval_connectform(info: tprograminfo); var   c:tcomponent; begin   c := application.findcomponent(info.paramasstring[0]);   if not (c tform)     info.resultasvariant := null   else     info.resultasvariant := tdwsrttivariant.fromobject(c); end; 

the next script works fine except line f.formstyle := 2; , error "invalid class typecast"

showmessage('step1');  var f:rttivariant<vcl.forms.tform> := connectform('form1');  f.alphablendvalue := 0; f.alphablend := true; f.hide; f.color := $00ffff;  showmessage('step2');  f.formstyle := 2; //f.formstyle := tformstyle(2);  f.show; f.alphablend := false;  showmessage('step3'); 

how can set enumerated properties formstyle or borderstyle

thanks


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -