lxpbuaa Posted March 27, 2017 Share Posted March 27, 2017 At runtime, change Form.NavigateKeys.Enabled or Form.NavigateKeys.Nex.Key, it doesnt work. e.g. procedure TEditDataForm.OnMemoEnter(Sender: TObject); begin NavigateKeys.Next.Key := 0; NavigateKeys.Enabled := False; end; procedure TEditDataForm.OnMemoExit(Sender: TObject); begin NavigateKeys.Next.Key := 13; NavigateKeys.Enabled := True; end; It means when the focus is in Memo editor, I can enter RETURN key as a line feed. How can I do it? Thanks! Link to comment Share on other sites More sharing options...
Sherzod Posted March 27, 2017 Share Posted March 27, 2017 Hi, It means when the focus is in Memo editor, I can enter RETURN key as a line feed. How can I do it? Maybe this will help you: http://forums.unigui.com/index.php?/topic/6194-navigatekeys-unimemo/&do=findComment&comment=31702 UniMemo1 -> ClientEvents -> ExtEvents ... add keydown fn: function keydown(sender, e, eOpts) { if (e.getKey() == e.ENTER) { e.stopPropagation(); } } Best regards. Link to comment Share on other sites More sharing options...
lxpbuaa Posted March 28, 2017 Author Share Posted March 28, 2017 Delphi DeveloperThanks a lot! Link to comment Share on other sites More sharing options...
lxpbuaa Posted March 28, 2017 Author Share Posted March 28, 2017 Hi, Maybe this will help you: http://forums.unigui.com/index.php?/topic/6194-navigatekeys-unimemo/&do=findComment&comment=31702 UniMemo1 -> ClientEvents -> ExtEvents ... add keydown fn: function keydown(sender, e, eOpts) { if (e.getKey() == e.ENTER) { e.stopPropagation(); } } Best regards. HI, I can't set the clienevent at runtime? Because the Memo editor is created dynamicly. e.g. TUniMemo(Editor).ClientEvents.ExtEvents.Add ('keydown=function keydown(sender, e, eOpts) {if (e.getKey()== e.ENTER) {e.stopPropagation();}}'); Link to comment Share on other sites More sharing options...
Sherzod Posted March 28, 2017 Share Posted March 28, 2017 Hi, Memo.ClientEvents.ExtEvents.Values['keydown'] := 'function keydown(sender, e, eOpts) {if (e.getKey() == e.ENTER) {e.stopPropagation()}}'; Link to comment Share on other sites More sharing options...
lxpbuaa Posted March 28, 2017 Author Share Posted March 28, 2017 Thank you! Link to comment Share on other sites More sharing options...
lxpbuaa Posted March 28, 2017 Author Share Posted March 28, 2017 Oh, sorry ,unfortunately, the memo created at runtime doesnt work. UniMemo1 is ok, but Memo doesnt work. Can you help me? procedure TMainForm.UniFormCreate(Sender: TObject); const KeyDownText = 'function keydown(sender, e, eOpts) {if (e.getKey() == e.ENTER) {e.stopPropagation()}}'; var Memo: TUniMemo; begin Memo := TUniMemo.Create(self); Memo.Parent := self; Memo.Left := 50; Memo.ClientEvents.ExtEvents.Values['keydown'] := KeyDownText; UniMemo1.ClientEvents.ExtEvents.Values['keydown'] := KeyDownText; end; Link to comment Share on other sites More sharing options...
Sherzod Posted March 28, 2017 Share Posted March 28, 2017 Memo.Name = ? You must assign the Name Link to comment Share on other sites More sharing options...
lxpbuaa Posted March 28, 2017 Author Share Posted March 28, 2017 Memo.Name = ? You must assign the Name OK, Thanks!!! Link to comment Share on other sites More sharing options...
clovishulse Posted May 23, 2018 Share Posted May 23, 2018 Hi. I used this solution but from the FMSoft_uniGUI_Complete_Professional_1.10.0 doesn't work. What is the soluction? Link to comment Share on other sites More sharing options...
Sherzod Posted May 23, 2018 Share Posted May 23, 2018 Hi, Are you using a trial edition?! Link to comment Share on other sites More sharing options...
clovishulse Posted May 23, 2018 Share Posted May 23, 2018 No. Version FMSoft_uniGUI_Complete_Professional_1.10.0.1459 Link to comment Share on other sites More sharing options...
Sherzod Posted May 23, 2018 Share Posted May 23, 2018 First of all please visit here: http://forums.unigui.com/index.php?/topic/6291-new-users-please-adjust-your-forum-email-address/ Link to comment Share on other sites More sharing options...
webdev Posted May 23, 2018 Share Posted May 23, 2018 Hi. Ready. My account is correct. Link to comment Share on other sites More sharing options...
Sherzod Posted May 24, 2018 Share Posted May 24, 2018 Hi, Thanks for the update. Can you make a simple testcase for your issue?! Link to comment Share on other sites More sharing options...
webdev Posted May 24, 2018 Share Posted May 24, 2018 Hi. How to send the test programa by attachment? Link to comment Share on other sites More sharing options...
Sherzod Posted May 24, 2018 Share Posted May 24, 2018 How to send the test programa by attachment? Link to comment Share on other sites More sharing options...
webdev Posted May 24, 2018 Share Posted May 24, 2018 Hi. Test program. Test.zip Link to comment Share on other sites More sharing options...
Sherzod Posted May 25, 2018 Share Posted May 25, 2018 Hi, One possible solution: UniMemo -> ClientEvents -> ExtEvents -> function afterrender(sender, eOpts) { sender.bodyEl.dom.addEventListener( 'keydown', function(e) {if (e.key=='Enter') {e.stopPropagation()}} ); } Best regards, Link to comment Share on other sites More sharing options...
webdev Posted May 25, 2018 Share Posted May 25, 2018 Hi. TUniMemo = OK TUniDBMemo = No (doesn't work) Link to comment Share on other sites More sharing options...
Sherzod Posted May 25, 2018 Share Posted May 25, 2018 Hi, TUniDBMemo = No (doesn't work) I couldn't reproduce, works for me Please make a simple testcase for this if possible Link to comment Share on other sites More sharing options...
webdev Posted May 28, 2018 Share Posted May 28, 2018 Hi. New Test with DBMemo. Test.zip Link to comment Share on other sites More sharing options...
Sherzod Posted May 28, 2018 Share Posted May 28, 2018 Hi, Please use this approach for now: Hi, One possible solution: UniMemo -> ClientEvents -> ExtEvents -> function afterrender(sender, eOpts) { sender.bodyEl.dom.addEventListener( 'keydown', function(e) {if (e.key=='Enter') {e.stopPropagation()}} ); } Best regards, Link to comment Share on other sites More sharing options...
webdev Posted May 28, 2018 Share Posted May 28, 2018 Hi. In the test application it worked correctly. But in my project only when assigning in the Form.OnShow. Thanks. Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 28, 2018 Administrators Share Posted May 28, 2018 Changing NavigateKey after form is created in not natively supported and it is not easy to implement. I see that DD has tried to achieve a solution, but why do you need this in the first place? Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now