Jump to content

JS Code To Allow Pressing ENTER Within TUniDBMemo (or TUniMemo) Does Not Work


Frederick

Recommended Posts

When I am within a TUniDBMemo, I want to be able to press the ENTER key to insert a carriage return and line feed within the memo.

Based on an earlier forum post, I entered the following:-

UniDBMemo1 -> ClientEvents -> ExtEvents ... add keydown fn:

function keydown(sender, e, eOpts)
{
  if (e.getKey() == e.ENTER) {
    e.stopPropagation();
  }
}

However, UniGUI is not responding to the above event. If the ENTER key is pressed within the memo, focus moves to the next component of the form.

My form's KeyPreview is True while the NavigateKeys.Next.Key is set to 13. Setting the former to False or disabling NavigateKeys on entering the memo control does nothing.

What am I missing here?

--
Frederick
(UniGUI Complete - Professional Edition 1.90.0.1514)
 

Link to comment
Share on other sites

4 hours ago, Frederick said:

When I am within a TUniDBMemo, I want to be able to press the ENTER key to insert a carriage return and line feed within the memo.

Based on an earlier forum post, I entered the following:-

UniDBMemo1 -> ClientEvents -> ExtEvents ... add keydown fn:

function keydown(sender, e, eOpts)
{
  if (e.getKey() == e.ENTER) {
    e.stopPropagation();
  }
}

However, UniGUI is not responding to the above event. If the ENTER key is pressed within the memo, focus moves to the next component of the form.

My form's KeyPreview is True while the NavigateKeys.Next.Key is set to 13. Setting the former to False or disabling NavigateKeys on entering the memo control does nothing.

What am I missing here?

--
Frederick
(UniGUI Complete - Professional Edition 1.90.0.1514)

Try this approach too:

http://forums.unigui.com/index.php?/topic/8238-change-formnavigatekeys-at-runtime/&do=findComment&comment=55862

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...