delphi - Focus next control on enter - in overridden KeyUp -
i have custom class extends tedit:
tmytextedit = class (tedit) private ffocusnextonenter: boolean; public procedure keyup(var key: word; shift :tshiftstate); override; published property focusnextonexnter: boolean read ffocusnextonenter write ffocusnextonenter default false; end;
in keyup procedure do:
procedure tmytextedit.keyup(var key: word; shift: tshiftstate); begin inherited; if focusnextonexnter if key = vk_return selectnext(self twincontrol, true, false); end;
but isn't moving focus next control. tried
if key = vk_return key := vk_tab;
but isn't working either. missing?
selectnext
selects next sibling child control, ie. need call on edit's parent:
type thackwincontrol = class(twincontrol); if key = vk_return if assigned(parent) thackwincontrol(parent).selectnext(self, true, false);
Comments
Post a Comment