# Editing Text

> Edit text in the Document Editor from JavaScript: select and insert text, find and replace, undo and redo, clipboard, overwrite mode and keyboard shortcuts.

- **Product:** TX Text Control .NET Server
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET Server > Document Editor > Editing Text
- **6372 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/editing-text/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/editing-text/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/editing-text/llms-full.txt

---

Inserting text blocks, replacing placeholders and navigating through a document all come down to reading and changing the text in the Document Editor. Through the JavaScript API, your code selects text, sets the input position, inserts and replaces text, reads paragraphs and lines and finds text, and it works with undo and redo, the clipboard and the overwrite mode.

The examples extend the view of the [ASP.NET Core](https://docs.textcontrol.com/tx-text-control-dotnet-server/getting-started/document-editor/aspnet-core/llms-full.txt) tutorial, whose document contains the text "Welcome to Text Control". Formatting is explained on [Text and Paragraph Formatting](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/formatting/llms-full.txt).

### Text Positions

Text positions are counted in characters. Two counting methods occur in the API, and the reference states which one a member uses:

- **Zero-based** positions start with 0 for the first character. The selection, [find](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattedtext/find-method/llms-full.txt) and `setInputPositionByTextPosition` use them.
- **One-based** numbers start with 1. The `getStart` methods of paragraphs, lines and pages return them.

A paragraph end or a line break counts as one character.

### Select Text

Your code selects text in three ways:

- Assign the start position and the length to [TXTextControl.selection](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/selection-property/llms-full.txt): `TXTextControl.selection = { start: 0, length: 7 };`.
- Call [select](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/select-method/llms-full.txt) with the start, the length and a callback. Use it when the next step depends on the selection, because the callback tells you when it has been made.
- Call [selectAll](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/selectall-method/llms-full.txt) to select the whole text, or [selectWord](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/selectword-method/llms-full.txt) to select the word at the input position.

The [Selection](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/selection/llms-full.txt) object passes the selected text with [getText](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/selection/gettext-method/llms-full.txt), and its position with [getStart](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/selection/getstart-method/llms-full.txt) and [getLength](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/selection/getlength-method/llms-full.txt).

### Insert and Replace Text

[Selection.setText](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/selection/settext-method/llms-full.txt) replaces the selected text. Without a selection, it inserts the text at the input position; with an empty string, it deletes the selection. [Selection.load](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/selection/load-method/llms-full.txt) inserts formatted text instead, for example HTML encoded with [btoaUTF8](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/btoautf8-method/llms-full.txt).

To place the input position first, [setInputPositionByTextPosition](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/setinputpositionbytextposition-method/llms-full.txt) takes a zero-based text position and a value of [TextFieldPosition](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/textfieldposition-enumeration/llms-full.txt), which decides whether the position lies inside or outside a field at that place. [setInputPositionByPage](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/setinputpositionbypage-method/llms-full.txt) takes a page, a line and a column instead.

The following code inserts text at the beginning of the document, inserts formatted text at the input position, inserts a page break and logs the paragraph at the input position. Add it below the editor in *Views/Home/Index.cshtml*:

```html
<input type="button" onclick="insertAtStart()" value="Insert at Start" />
<input type="button" onclick="insertFormattedText()" value="Insert Formatted Text" />
<input type="button" onclick="insertPageBreak()" value="Insert Page Break" />
<input type="button" onclick="logCurrentParagraph()" value="Log Paragraph" />

<script>
    function insertAtStart() {
        // The first text position is 0
        TXTextControl.setInputPositionByTextPosition(0,
            TXTextControl.TextFieldPosition.OutsideTextField, function () {
                TXTextControl.selection.setText("DRAFT ", function () {
                    TXTextControl.focus();
                });
            });
    }

    function insertFormattedText() {
        var html = "<p>Signed by <strong>Tim Typer</strong></p>";
        TXTextControl.selection.load(TXTextControl.StreamType.HTMLFormat, TXTextControl.btoaUTF8(html));
    }

    function insertPageBreak() {
        TXTextControl.inputPosition.getTextPosition(function (textPosition) {
            TXTextControl.textChars.addControlChar(TXTextControl.ControlChars.PageBreak, textPosition,
                function (added) {
                    console.log("Page break inserted: " + added);
                });
        });
    }

    function logCurrentParagraph() {
        TXTextControl.inputPosition.getTextPosition(function (textPosition) {
            TXTextControl.paragraphs.getItem(textPosition, function (paragraph) {
                paragraph.getText(function (text) {
                    console.log("Paragraph at " + textPosition + ": " + text);
                });
            });
        });
    }
</script>
```

The code works as follows:

- `insertAtStart` moves the input position to the beginning, inserts the text and gives the input focus back to the editor with [focus](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/focus-method/llms-full.txt), so that the user can continue typing.
- [TXTextControl.inputPosition](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/inputposition-property/llms-full.txt) returns the [InputPosition](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/inputposition/llms-full.txt). [getTextPosition](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/inputposition/gettextposition-method/llms-full.txt) passes its text position; `getPage`, `getLine` and `getColumn` pass the other parts.
- [TextCharCollection.addControlChar](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/textcharcollection/addcontrolchar-method/llms-full.txt) inserts a control character, a value of [ControlChars](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/controlchars-enumeration/llms-full.txt) such as `PageBreak`, `LineBreak`, `Tab` or `NonBreakingSpace`.
- [ParagraphCollection.getItem](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/paragraphcollection/getitem-method/llms-full.txt) passes the paragraph at a text position, and [Paragraph.getText](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/paragraph/gettext-method/llms-full.txt) its text.

### Read the Text of a Document

The main text and every other text part provide collections of their building blocks:

| Collection | Contains | Useful methods |
|---|---|---|
| [paragraphs](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattedtext/paragraphs-property/llms-full.txt) | The paragraphs | [Paragraph.getText](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/paragraph/gettext-method/llms-full.txt), [getStart](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/paragraph/getstart-method/llms-full.txt), [getLength](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/paragraph/getlength-method/llms-full.txt), [select](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/paragraph/select-method/llms-full.txt) |
| [lines](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattedtext/lines-property/llms-full.txt) | The lines | [Line.getText](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/line/gettext-method/llms-full.txt), [getPage](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/line/getpage-method/llms-full.txt) |
| [textChars](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattedtext/textchars-property/llms-full.txt) | The characters | [TextChar.getChar](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/textchar/getchar-method/llms-full.txt); the collection also adds and removes characters |
| [TXTextControl.pages](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/pages-property/llms-full.txt) | The pages, in the page view | [Page.getStart](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/page/getstart-method/llms-full.txt), [getLength](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/page/getlength-method/llms-full.txt), [select](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/page/select-method/llms-full.txt) |

[TXTextControl.getText](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/gettext-method/llms-full.txt) passes the complete text of the document, and [getPageCount](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/getpagecount-method/llms-full.txt) the number of pages. Note the parameter orders in the reference: `LineCollection.getItem`, for example, takes the callback before the text position.

### Remove Empty Pages

A template that contains a page break followed by a paragraph that starts on a new page, or two page breaks in a row, produces an empty page. Such a page contains only the break character, so its length is 1. The following function goes through the pages from the last to the first and deletes that character on every empty page:

```javascript
function removeEmptyPages() {
  TXTextControl.pages.getCount(function (count) {

    function processPage(index) {
      if (index < 0) {
        return; // all pages processed
      }

      TXTextControl.pages.elementAt(index, function (page) {
        page.getLength(function (length) {
          if (length !== 1) {
            processPage(index - 1);
            return;
          }

          // getStart is one-based, select is zero-based
          page.getStart(function (start) {
            TXTextControl.select(start - 1, length, function () {
              TXTextControl.selection.setText("", function () {
                processPage(index - 1);
              });
            });
          });
        });
      });
    }

    // Start with the last page, so that deleting doesn't renumber the pages still to check
    processPage(count - 1);
  });
}
```

The code works as follows:

- [TXTextControl.pages](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/pages-property/llms-full.txt) returns the [PageCollection](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/pagecollection/llms-full.txt), which exists only in the page view. [getCount](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/collection/getcount-method/llms-full.txt) passes the number of pages and [elementAt](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/collection/elementat-method/llms-full.txt) a page by its zero-based index.
- [Page.getLength](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/page/getlength-method/llms-full.txt) passes the number of characters on the page. A length of 1 means that the page holds nothing but a page or section break.
- [Page.getStart](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/page/getstart-method/llms-full.txt) passes the one-based position of the first character, so the code subtracts 1 for `select`. `setText` with an empty string deletes the selected break.
- `processPage` calls itself from the callbacks, so each page is checked only after the previous change has been made.

In a letter with two page breaks in a row, the function reduces three pages to two. The blog article [Removing Empty Pages in TX Text Control with JavaScript](https://www.textcontrol.com/blog/2024/06/19/removing-empty-pages-in-tx-textcontrol-with-javascript/) shows the scenario. On the server, "Remove Empty Pages" in [Pages](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-processing/pages/#remove-empty-pages) does the same with `ServerTextControl`.

### Find and Replace Text

[find](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/formattedtext/find-method/llms-full.txt) searches for a text from a zero-based start position (`-1` for the input position) and passes the position of the first match to its callback, or `-1`. Its optional third parameter is a value of [FindOptions](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/findoptions-enumeration/llms-full.txt): `MatchCase`, `MatchWholeWord`, `Reverse`, `NoHighlight` or `NoMessageBox`.

The following code replaces every "Welcome" with "Hello" as one undo step and undoes the last action. A helper function turns a method with a callback into a promise, as described on [JavaScript API](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/javascript-api/#promises-and-async-await):

```html
<input type="button" onclick="replaceAll('Welcome', 'Hello')" value="Replace All" />
<input type="button" onclick="undoLastAction()" value="Undo" />

<script>
    // Calls a method of the JavaScript API and waits for its callback
    function request(target, method) {
        var args = Array.prototype.slice.call(arguments, 2);
        return new Promise(function (resolve, reject) {
            target[method].apply(target, args.concat([resolve, reject]));
        });
    }

    async function replaceAll(searchText, replacementText) {
        var count = 0;
        var options = TXTextControl.FindOptions.NoMessageBox;

        // Undo all replacements in one step
        await request(TXTextControl, "beginUndoAction", "Replace all");

        var position = await request(TXTextControl, "find", searchText, 0, options);

        while (position !== -1) {
            await request(TXTextControl, "select", position, searchText.length);
            await request(TXTextControl.selection, "setText", replacementText);
            count++;

            // Continue behind the inserted text
            position = await request(TXTextControl, "find", searchText,
                position + replacementText.length, options);
        }

        await request(TXTextControl, "endUndoAction");
        console.log(count + " replacements");
    }

    async function undoLastAction() {
        var canUndo = await request(TXTextControl, "getCanUndo");

        if (!canUndo) {
            console.log("Nothing to undo");
            return;
        }

        var actionName = await request(TXTextControl, "getUndoActionName");
        await request(TXTextControl, "undo");
        console.log("Undone: " + actionName);
    }
</script>
```

- `NoMessageBox` keeps `find` from showing message boxes about the search result.
- `select` selects each match, and `setText` replaces it. The next search starts behind the inserted text, so that a replacement that contains the search text isn't found again.
- [beginUndoAction](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/beginundoaction-method/llms-full.txt) and [endUndoAction](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/endundoaction-method/llms-full.txt) make all replacements one step, named "Replace all".

Click **Replace All**: "Welcome" becomes "Hello". Click **Undo** to restore it in one step. For users, [showDialog](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/showdialog-method/llms-full.txt) opens the built-in dialog boxes with `FindDialog` or `ReplaceDialog`, which the **Find...** and **Replace...** buttons of the **Home** tab open as well:

```javascript
TXTextControl.showDialog(TXTextControl.DialogBoxKind.ReplaceDialog);
```

![Replace dialog box of the Document Editor with the Find what and Replace with boxes, the options Match case, Match whole word only and Search up, and check boxes for searching the main text, footnotes, text frames and headers and footers](https://docs.textcontrol.com/assets/img/tx-text-control-dotnet-server/replace-dialog.3d768676.webp)

### Undo and Redo

| Method | Does |
|---|---|
| [undo](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/undo-method/llms-full.txt), [redo](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/redo-method/llms-full.txt) | Undoes or redoes the last action |
| [getCanUndo](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/getcanundo-method/llms-full.txt), [getCanRedo](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/getcanredo-method/llms-full.txt) | Passes whether there is something to undo or redo |
| [getUndoActionName](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/getundoactionname-method/llms-full.txt), [getRedoActionName](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/getredoactionname-method/llms-full.txt) | Passes the name of that action; `getUndoActionName` passes `null` if nothing can be undone |
| [clearUndo](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/clearundo-method/llms-full.txt) | Clears the undo buffer |
| [setAllowUndo](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/setallowundo-method/llms-full.txt) | Turns the undo buffer on or off |

Without grouping, each change is a step of its own: inserting a table and filling its 25 cells, for example, makes 26 steps. Grouped changes are also displayed at once, which avoids flickering, as the blog article [JavaScript: Avoid Flickering and Visual Updates by Grouping Undo Steps](https://www.textcontrol.com/blog/2022/07/25/javascript-avoid-flickering-and-visual-updates-by-grouping-undo-steps/) shows.

### Clipboard, Overwrite Mode and Drag and Drop

- **Clipboard.** Users copy, cut and paste with Ctrl+C, Ctrl+X and Ctrl+V. [clipboardMode](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/clipboardmode-property/llms-full.txt) decides which clipboard these keys use: `Client` from [ClipboardMode](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/clipboardmode-enumeration/llms-full.txt) uses the clipboard of the user's computer, which accepts RTF, HTML, plain text and images from other applications; `Server` uses an internal clipboard that keeps all TX Text Control features. The JavaScript API has no copy or paste methods. [getCanCopy](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/getcancopy-method/llms-full.txt) and [getCanPaste](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/getcanpaste-method/llms-full.txt) pass whether copying and pasting are possible, and the `textPasted` event lets your code cancel pasted text.
- **Overwrite mode.** [setInsertionMode](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/setinsertionmode-method/llms-full.txt) switches between `Insert` and `Overwrite` from [InsertionMode](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/insertionmode-enumeration/llms-full.txt), and [getInsertionMode](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/getinsertionmode-method/llms-full.txt) passes the current mode. Added in version 34.0.
- **Deleting.** [clear](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/clear-method/llms-full.txt) deletes the selected text or the character to the right of the input position. [resetContents](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/resetcontents-method/llms-full.txt) deletes the whole content.
- **Drag and drop.** [setAllowDrag](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/setallowdrag-method/llms-full.txt) and [setAllowDrop](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/setallowdrop-method/llms-full.txt) set whether the editor can be the source of a drag operation and whether it accepts dropped data. The `textDropped` and `fileDropped` events let your code cancel a drop.

The following lines use the client clipboard and log pasted text:

```javascript
TXTextControl.addEventListener("textControlLoaded", function () {
  // Ctrl+C, Ctrl+X and Ctrl+V use the clipboard of the local computer
  TXTextControl.clipboardMode = TXTextControl.ClipboardMode.Client;

  TXTextControl.addEventListener("textPasted", function (e) {
    console.log("Pasted " + e.textType + ": " + e.text);
  });
});
```

Whether text can be changed at all depends on the edit mode and the document permissions; see [Document Protection](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/protection/llms-full.txt). The events for the input position, the clipboard, pasting and dropping are listed on [Events](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/events/llms-full.txt).

### Keyboard and Mouse

Users edit in the Document Editor with the keys and mouse actions of a word processor. The following tables list the assignments of TX Text Control that apply to the Document Editor of `TXTextControl.Web` 34.5.0.

| Key | Action |
|---|---|
| Left Arrow, Right Arrow | Moves the input position one character to the left or to the right |
| Up Arrow, Down Arrow | Moves the input position one line up or down |
| Home, End | Moves the input position to the beginning or the end of the line |
| Ctrl+Left Arrow, Ctrl+Right Arrow | Moves the input position to the beginning of the current or the next word |
| Ctrl+Home, Ctrl+End | Moves the input position to the beginning or the end of the text |
| Page Up, Page Down | Scrolls the text up or down by the height of the visible area minus one line, if the editor has a vertical scroll bar |
| Shift+Page Up, Shift+Page Down | Scrolls the document horizontally |
| Shift together with an arrow key, Home, End or Ctrl+arrow key | Extends the selection to the new input position |
| Shift+Enter | Inserts a line break without starting a new paragraph |
| Ctrl+Enter | Inserts a page break |
| Ctrl+Shift+Space | Inserts a non-breaking space |
| Del | Deletes the selected text |
| Ctrl+Z, Ctrl+Y | Undoes the last action, or restores the last undone action |

Hyphens and dashes have keys of their own. The second column says whether a line can be divided after the character:

| Key | Inserts | Line can break after it |
|---|---|---|
| Hyphen | A hyphen or minus sign | Yes |
| Ctrl+Shift+Hyphen | A non-breaking hyphen for compound words | No |
| Ctrl+Minus on the numeric keypad | An en dash | Yes |
| Ctrl+Alt+Minus on the numeric keypad | An em dash | Yes |

| Mouse action | Action |
|---|---|
| Click | Moves the input position to the point of the click, or selects the image or text frame that is clicked |
| Click and drag | Selects the text from the point where the button is pressed to the point where it is released, or moves an image or a text frame |
| Shift+click | Extends the selection to the position of the click |
| Double-click | Selects the word |
| Double-click and drag | Extends the selection word by word |
| Triple-click | Selects the paragraph |
| Triple-click and drag | Extends the selection paragraph by paragraph |
| Drag selected text and drop it | Moves the text to the drop position |
| Ctrl while dragging selected text and dropping it | Copies the text to the drop position |
| Click in the left page margin | Selects the line next to the click |

In tables, these keys and mouse actions apply as well:

| Key or mouse action | Action |
|---|---|
| Tab, Shift+Tab | Selects the next or the previous cell |
| Click left of a table row | Selects the table row |
| Click the top of a table column in the first row | Selects the table column |

Dragging and dropping text works only while [setAllowDrag](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/setallowdrag-method/llms-full.txt) and [setAllowDrop](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/setallowdrop-method/llms-full.txt) allow it, as described in [Clipboard, Overwrite Mode and Drag and Drop](#clipboard-overwrite-mode-and-drag-and-drop).

The desktop controls of TX Text Control assign further keys: Ctrl+Backspace and Shift+Backspace to delete the previous word, Ctrl+Hyphen to insert an invisible hyphen at which a word can be divided at the end of a line, Ctrl+Shift+Enter to insert a column break, Ctrl+Page Up and Ctrl+Page Down to zoom, Ctrl+Tab to insert a tab character in a table cell, and a double-click in a table cell to select the cell. These assignments aren't confirmed for the Document Editor in a browser and are left out of the tables. How your code and the ribbon set the zoom is described in [Viewing and Printing](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/viewing-printing/llms-full.txt).

The keys for the clipboard are described in [Clipboard, Overwrite Mode and Drag and Drop](#clipboard-overwrite-mode-and-drag-and-drop).

### Next Steps

- [Text and Paragraph Formatting](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/formatting/llms-full.txt): format the text you insert.
- [Fields](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/fields/llms-full.txt): mark text to replace it later.
- [Viewing and Printing](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/viewing-printing/llms-full.txt): control characters, zoom and the status bar.

---

## Nearby

- **Previous:** [Document Properties](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/properties/llms-full.txt)
- **Next:** [Text and Paragraph Formatting](https://docs.textcontrol.com/tx-text-control-dotnet-server/document-editor/formatting/llms-full.txt)
