Jump to content

SelStart, SelLength in TUniMemo


Tokay

Recommended Posts

Hi,

 

Is it possible to set this parameter in a TUniMemo? Thank you.

 

One possible solution like in this post:

http://forums.unigui.com/index.php?/topic/9347-tuniedit-selstart/&do=findComment&comment=49258

 

(Ext.form.field.TextArea instead of Ext.form.field.Text)

Ext.form.field.TextArea.prototype._selectSE = function(start, end) {
    var input = document.getElementById(this.inputEl.id);
    if ('selectionStart' in input) {
        input.selectionStart = start;
        input.selectionEnd = end;
        input.focus();
    } else { // Internet Explorer before version 9
        var inputRange = input.createTextRange();
        inputRange.moveStart("character", 1);
        inputRange.collapse();
        inputRange.moveEnd("character", 1);
        inputRange.select();
    }
}
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...