delphi - SetFocus with Firemonkey, on a dynamic created TEdit from StyleBook -
i have custom styled tlistboxitem hidden tedit component. when select item in listbox, set tedit visible:
importfiles.selected.stylesdata['nameedit.visible'] := true; but have problem, how set focus tedit? normally, way:
edit1.setfocus(); any ideas, how set focus on tedit?
you need use findstyleresource access tedit style:
procedure form1.button1click(sender: tobject); var o: tfmxobject; begin if assigned(importfiles.selected) begin o := tfmxobject(importfiles.selected).findstyleresource('nameedit'); if o tedit begin tedit(o).visible := true; tedit(o).setfocus; end; end; end;
Comments
Post a Comment