Document Editor
A form with a TXTextControl on it is a word processor: users type, format text, insert tables and images and print, while your code loads and saves documents, reacts to events and adds commands of its own. The pages below cover each of these subjects, from the view modes and file formats to formatting, tables, fields, reviewing, protection, XML documents and printing.
If you haven't placed a TXTextControl on a form yet, start with Creating a Simple Word Processor. It creates the Visual Basic project, connects the button bar, the ruler bars and the status bar to the control and adds the menus that the tutorials here build on.
How the Editor Works
- One control holds the document. TXTextControl displays and edits a text document. Its view mode decides whether the user sees pages, a continuous text or a plain text box.
- The bars are separate controls. TXButtonBar, TXRulerBar and TXStatusBar are controls of their own that you connect to the
TXTextControl. - Built-in dialog boxes need one call. Methods such as
FontDialog,ParagraphDialog,TableAttrDialogandObjectAttrDialogopen the dialog boxes of TX Text Control. Built-in Dialog Boxes shows each of them, and the dialog box category of the reference lists their methods. - Most pages come with a sample. The Visual Basic tutorials explain sample programs whose source code is installed below Samples\vb6, and the technical articles explain how the properties, methods and events of one subject work together.
Find the Right Page
| If you want to | Read |
|---|---|
| Choose between page view, normal view and the other view modes | Text Formatting and Views |
| Load and save RTF, HTML, DOC, DOCX and other formats | Working with Files |
| Load or insert files that users drop on the control | File Drag and Drop |
| Read and write the title, author and keywords of a document | Document Properties |
| Add page setup, print, search and color dialog boxes | A Word Processor |
| Insert tables, calculate cells with formulas and format numbers | Tables |
| Place images and text frames in a document | Using Images, Using Text Frames |
| Add headers and footers | Headers and Footers |
| Mark text with fields, hypertext links, bookmarks or Word fields | Marked Text Fields |
| Open, edit and program XML documents | Working with XML Files |
| Print, print page by page or show a print preview | Printing |
| Format characters and paragraphs, set tabs and paragraph frames | Character and Paragraph Formatting |
| Create, change and apply formatting styles | Stylesheets |
| Add bulleted, numbered and structured lists | Bulleted and Numbered Lists |
| Divide a document into sections, set page size, margins, columns and page borders | Sections and Page Setup |
| Insert and number footnotes | Footnotes |
| Generate and update a table of contents | Tables of Contents |
| Build forms with text, check box, drop-down and date fields | Form Fields, Signature Fields |
| Track, review, accept and reject changes, or comment on text | Track Changes, Comments |
| Protect a document and mark editable regions for users | Document Protection |
| Underline misspelled words and offer corrections | Spell Checking |
| Select text, use the clipboard, undo and redo | Selections, Clipboard and Undo |
| Connect the button bar, rulers and status bar | Button Bar, Ruler Bar and Status Bar |
| Open the dialog boxes built into TXTextControl | Built-in Dialog Boxes |
Where to Start
- Work through Creating a Simple Word Processor.
- Read Text Formatting and Views for the view modes and the twips that TX Text Control measures in.
- Continue with A Word Processor, which adds the dialog boxes of a complete word processor.
- Open the page of the feature you are adding.
Pages in This Section
- Text Formatting and Views: twips, view modes and page sizes.
- Working with Files: file formats, loading and saving.
- File Drag and Drop: files dropped on the control.
- Document Properties: title, subject, author and keywords.
- A Word Processor: dialog boxes, search and paragraph frames.
- Tables: table identifiers, formulas and number formats.
- Using Images: inserting images and setting their attributes.
- Using Text Frames: text frames and printed labels.
- Headers and Footers: headers, footers and their activation.
- Marked Text Fields: fields, hypertext links, bookmarks and Word fields.
- Working with XML Files: XML documents with CSS and DTD.
- Printing: printing, paper bins and print preview.
- Character and Paragraph Formatting: fonts, attributes, alignment, indents, tabs and frames.
- Stylesheets: paragraph and character styles.
- Bulleted and Numbered Lists: list types, levels and number formats.
- Sections and Page Setup: sections, page size, margins, columns and page borders.
- Footnotes: inserting, numbering and listing footnotes.
- Tables of Contents: generating and updating a table of contents.
- Form Fields: text, check box, combo box, drop-down and date fields.
- Signature Fields: signature fields and their signer data.
- Track Changes: tracking, reviewing, accepting and rejecting changes.
- Comments: comments, replies and their highlighting.
- Document Protection: permissions, protection and editable regions.
- Spell Checking: the SpellCheckText event and TX Spell .NET.
- Selections, Clipboard and Undo: selections, the clipboard, undo, search and the keyboard.
- Button Bar, Ruler Bar and Status Bar: the three bars and how they connect.
- Built-in Dialog Boxes: the dialog boxes TXTextControl opens itself.