TX Text Control ActiveX Programmer's Guide

Welcome to TX Text Control, the text processor in a single ActiveX control. Using TX Text Control, you can create all kinds of text-based applications with the ease of programming that is characteristic of Visual Basic and with highly sophisticated formatting and display capabilities which are normally the exclusive domain of large word processing packages.

As an aid to help you locate the information that interests you most, the following section lists and describes the main areas of the documentation.

  • Introduction

    Provides information about the system reqirements you need, how to distribute your applications and how to obtain technical support.

  • What's New

    The chapter discusses the new features introduced in the last TX Text Control releases.

  • Visual Basic User's Guide

    Describes how to use TX Text Control with Microsoft Visual Basic.

  • Internet Explorer User's Guide

    This chapter describes how to use TX Text Control with the Microsoft Internet Explorer.

  • ASP User's Guide

    Demonstrates the usage of the TX Text Control features in the Microsoft Internet Information Server with ASP.

  • Delphi User's Guide

    Shows you how to install and use TX Text Control with Borland Delphi.

  • Technical Articles

    This chapter contains several technical articles, giving you an overview of TX Text Control's properties, methods and events working together.

  • Programmming Overview

    This part contains an overview of TX Text Control's properties, methods and events sorted by programming categories, lists all used data types and contains a reference of the mouse- and keyboard interface.

  • Reference

    Contains a complete reference of all properties, methods and events provided through the implemented TX Text Control controls and objects. All properties, methods and events are sorted in alphabetical order.


Introduction

Provides information about the system reqirements you need, how to distribute your applications and how to obtain technical support.

System Requirements

Distributing your Applications

Installing TX Text Control on a Server

Legal Notice

How to Obtain Support


System Requirements

The TX Text Control ActiveX requires one of the following Windows versions:

  • Windows 95
  • Windows 98
  • Windows ME
  • Windows NT 4.0
  • Windows 2000
  • Windows XP
  • Windows Vista
  • Windows 7
  • Windows 8
  • Windows 8.1

The TX Text Control ActiveX supports the following development enviroments or scripting engines:

  • Microsoft Visual Basic 4.0, 5.0, 6.0
  • Borland Delphi 4.0, 5.0, 6.0, 7.0
  • Microsoft Internet Explorer 5.0 or higher
  • Microsoft Internet Information Server 5.0, 5.1, 6.0, 7.x, 8.x

Furthermore, TX Text Control can be used with other development platforms which support ActiveX controls. To learn to which extent TX Text Control is supported by these development platforms, please contact the support department.


Distributing your Applications

If you create a setup program for your VB application with the Package and Deployment Wizard that is part of Visual Basic 6, all redistributable files will be included automatically.

In case you wish to use a different setup toolkit or install TX Text Control on a server, the lists below shows all the files necessary for Text Control to operate properly. You must ensure that the files exist on your client's machine and they are the proper version. If your client's machine has older versions of these files, you should update them.

Group 1: TX Text Control core files:

  • tx4ole24.ocx
  • tx24.dll
  • tx24_tls.dll
  • tx24_wnd.dll
  • tx24_obj.dll
  • tx24_ic.dll

Group 2: TX Text Control text filters:

  • tx24_rtf.dll
  • tx24_htm.dll
  • tx24_doc.dll
  • tx24_xml.dll
  • tx24_css.dll
  • tx24_pdf.dll
  • tx24_dox.dll

Group 3: Microsoft foundation class library:

  • MFC42.DLL (6.00.8447.0)
  • MSVCRT.DLL (6.00.8397.0)

Group 4: Microsoft XML parser:

  • MSXML3.DLL (8.00.7820.0)
  • MSXML3A.DLL (8.00.7820.0)
  • MSXML3R.DLL (8.00.7820.0)

The files listed in the first and second group are the TX Text Control DLL files. All of these files can be found in the \bin subdirectory of your TX Text Control installation directory. They must all be installed in the same directory and you must always install all of them. The first file is the Text Control ActiveX server containing the ActiveX controls. These controls must be registered in the registration database on your client's machine.

You should also verify that the Microsoft foundation class library files (group 3) are installed on your client's computer. These files must be installed in the Windows system directory. Please refer to Microsoft's redistribution policy if you need to redistribute them.

The files listed in the last group (group 4) contain the Microsoft XML parser and are necessary to use Text Control's XML features. These files must be installed in the Windows system directory. Please refer to Microsoft's redistribution policy if you need to redistribute them.

The following files must be registered in the registration database on your client's machine:

  • tx4ole24.ocx
  • MFC42.DLL
  • MSXML3.DLL

To register the Text Control ActiveX on a server the command line tool txregsvr.exe must be used as described in the next section.


Installing TX Text Control on a Server

Internet Information Server (IIS) needs to be installed in order to run TX Text Control in server mode. It can be run on a dedicated server, or by simply activating IIS on the developer's computer. This way, a server application can be developed and tested on the same computer, without requiring access to a seperate server.

At some point an application most likely is to be transfered to a 'real', dedicated server. The following steps are required to transfer your TX Text Control license to that server.

Note that the license agreement entitles you to have TX Text Control installed on your local computer and a single server at the same time, so that you may continue maintaining your application with a local copy of TX Text Control.

  • Copy the required files as listed in the table in Distributing your Applications from your local computer to a single directory on the server. The files are located in the \bin subdirectory of your Text Control installation.
  • Copy txregsvr.exe from Text Control's \tools subdirectory to the a directory on the server
  • On the server, run txregsvr.exe. Txregsvr is a command line tool which creates the registry keys required for Text Control to run on a server. It accepts two parameters, which are the filename and path of the Text Control ActiveX file, and your serial number. Running txregsvr.exe without a parameter displays usage information.
  • Remove txregsvr.exe from the server. Please note that txregsvr.exe is not a redistributable file, and therefore must not be kept on the server.


Legal Notice

Information in this document is subject to change without notice and does not represent a commitment on the part of Text Control GmbH. The Software described in this document is furnished under a license agreement. The Software may only be used or copied in accordance with the terms of this agreement.

Copyright 1991-2016 Text Control GmbH. All rights reserved.

Microsoft, Windows, ActiveX, Visual Basic, Visual C++, Developer Studio are either registered trademarks or trademarks of Microsoft Corporation in the USA and/or other countries.

Borland, Delphi are Trademarks of Borland Software Corporation.

The names of actual companies and products mentioned herein may be the trademarks of their respective owners.


How to Obtain Support

Every registered and free trial version user can benefit from our free, technical support.

Our support team provides several information sources for technical details. A good starting point for getting information is the TX Text Control Support Forum. Here you can post your problems and discuss it with our support staff and other experienced TX Text Control users.

If you are searching for further samples, then please have a look at the Source Code Library. This library has additional samples that are not provided in this release and is updated with new samples frequently.

If you would like to contact us via e-mail, we would be very obliged if you would use the Support Form.

We understand that there are some support cases where a one-to-one talk can solve some programming problem much quicker than endless e-mails.

Our customer services representatives and support agents speak English and German and are available to assist with all your sales and technical queries.

Contact Information

Please visit our website for contact details:

http://www.textcontrol.com/contact/info/


What's New

The chapter discusses the new features introduced in the last TX Text Control releases.

What's New in Version 24.0

What's New in Version 23.0

What's New in Version 22.0

What's New in Version 21.0

What's New in Version 20.0

What's New in Version 19.0

What's New in Version 18.0

What's New in Version 17.0

What's New in Version 16.0

What's New in Version 15.1

What's New in Version 15.0

What's New in Version 14.0

What's New in Version 13.0

What's New in Version 12.0

What's New in Version 11.0


What's New in Version 24.0

The following provides a general list of features that have been added since Text Control version 23.0.

New Features

New Properties, Methods and Events

Extended Properties, Methods and Events


New Features

Text Control 24.0 provides the following new features:

Feature | Description
Colored Paragraphs | A paragraph's background and the lines of a paragraph frame can be colored. The properties FrameColor and FrameLineColor can be used to get or to set such colors. The built-in dialog box for setting paragraph attributes, the TX TextControl file format and all text filters have been extended to support this feature.
Zooming | Zooming has been extended with new zoom options. These options can be used to zoom the contents of a TextControl so that either the whole page, the complete width of a page or the complete text of a line becomes visible. They can be used with the new Zoom method. The TXStatusBar control has been extended with two new buttons to support this feature.
Toolbars | The TXButtonBar and TXRulerBar can be set to read only now. When such a tool bar is set to read only, it still shows all formatting attributes of the connected TXTextControl, but formatting attributes cannot be changed.
Built-in Dialogboxes | The ParagraphDialog, TableAttrDialog and ObjectAttrDialog methods have got now an optional parameter which can be used to specify the tab which is shown when the dialog box is opened.
Text Fields | When a text field has a doubled input position at the beginning and at the end, each of these positions can be reached now with a mouse-click.


New Properties, Methods and Events

In TX Text Control 24.0 the following new properties, methods and events have been added:

Properties

Property | Description
TXTextControl.TXButtonBar.ReadOnly | Returns or sets a value determining the button bar's read only mode.
TXTextControl.TXRulerBar.ReadOnly | Returns or sets a value determining the ruler bar's read only mode.
TXTextControl.TXTextControl.FrameColor | Returns or sets the background color for selected paragraphs.
TXTextControl.TXTextControl.FrameLineColor | Returns or sets the color for the frame lines of selected paragraphs.

Methods

Method | Description
TXTextControl.TXTextControl.Zoom | Zooms the contents of the TextControl using the specified option.


Extended Properties, Methods and Events

In TX Text Control 24.0 the following properties, methods and events have been extended:

Properties

Property | Update Note
FieldNext Method | The data type of the FieldGroup parameter has been changed from Integer to Long to support the constants larger than &HFFFF.
ParagraphDialog Method | The optional parameter ActiveTab has been added. It can be used to specify the tab which is shown when the dialog box is opened.
TableAttrDialog Method | The optional parameter ActiveTab has been added. It can be used to specify the tab which is shown when the dialog box is opened.
ObjectAttrDialog Method | The optional parameter ActiveTab has been added. It can be used to specify the tab which is shown when the dialog box is opened.


What's New in Version 23.0

The following provides a general list of features that have been added since Text Control version 22.0.

New Features

New Properties, Methods and Events

Extended Properties, Methods and Events


New Features

Text Control 23.0 provides the following new features:

Feature | Description
Inserting Symbol Characters | A new dialog box is available to insert one or more symbol characters into the document. It is available with the InsertSymbolDialog method.
Saving Document Properties | General document properties such as creation date, keywords or author can be saved and loaded with all supported text formats using the new LoadSaveAttribute settings txCreationDate, txAuthor, txDocKeywords, txLastModificationDate, txDocSubject and txCreatorApplication.
Bulleted Lists | The bullet character is no longer limited to the Windows Symbol font. The new BulletAttribute setting txBulletFont specifies the name of the font used for the bullet character. The bullet character itself can be any Unicode character. The ListAttrDialog dialog box has been extended to specify a font and an Unicode character.
Inserting Text Frames | A new built-in mouse interface can be used to insert a text frame into the document. It is started, when the Width or Height parameter of the TextFrameInsert, TextFrameInsertAsChar or TextFrameInsertFixed method is set to zero. The end-user can then click into the document and draw a frame which determines the postion of the text frame. After releasing the mouse button the new text frame is created and inserted into the document.


New Properties, Methods and Events

In TX Text Control 23.0 the following new properties, methods and events have been added:

Methods

Method | Description
TXTextControl.TXTextControl.InsertSymbolDialog | Opens a modeless dialog box which can be used to insert symbol characters.


Extended Properties, Methods and Events

In TX Text Control 23.0 the following properties, methods and events have been extended:

Properties

Property | Update Note
LoadSaveAttribute Property | Has been extended with the txCreationDate, txAuthor, txDocKeywords, txLastModificationDate, txDocSubject and txCreatorApplication attributes to enable embedding of general document data such as creation date, keywords or author.
BulletAttribute Property | Has been extended with the txBulletFont setting which specifies the font used for the bullet character.


What's New in Version 22.0

The following provides a general list of features that have been added since Text Control version 21.0.

New Features

New Properties, Methods and Events

Extended Properties, Methods and Events


New Features

Text Control 22.0 provides the following new features:

Feature | Description
Merging documents | For better support when merging documents, the Append and AppendFromMemory methods have been added. These methods load text in a certain format from a file, a byte array or a string and append it to the existing document. It can be specified that the document is appended at the end of the existing document or if a new paragraph or section is created for the appended document.
Loading and Saving Images | TX Text Control now uses Windows Imaging Component (WIC), a Component Object Model based imaging codec framework for working with and processing digital images and image metadata. The Tagged Image Format (.TIF) and Graphics Interchange Format (.GIF) image formats can now additionally be used for exporting images. The ImageExportFormat and the txImageExportFormat (19) constant of the LoadSaveAttribute property support this feature.
Programming Features | Some new properties and methods have been added. The ParagraphCount property and the ParagraphSelect method extend programming with paragraphs and the GetCaretRect and the GetCharRect methods support programming with the text input position.


New Properties, Methods and Events

In TX Text Control 22.0 the following new properties, methods and events have been added:

Properties

Property | Description
TXTextControl.TXTextControl.PageCount | Returns the number of pages, the document contains.
TXTextControl.TXTextControl.ParagraphCount | Returns the number of paragraphs, the document contains.
TXTextControl.TXTextControl.SupportedFonts | This property returns a string specifying the names of all available fonts.

Methods

Method | Description
TXTextControl.TXTextControl.Append | Appends text in a certain format from a file and inserts it at the end of the current document.
TXTextControl.TXTextControl.AppendFromMemory | Appends text in a certain format from a buffer and inserts it at the end of the current document.
TXTextControl.TXTextControl.GetCaretRect | Returns the rectangular area covered by the caret which indicates the current text input position.
TXTextControl.TXTextControl.GetCharRect | Returns the rectangular area covered by a certain character.
TXTextControl.TXTextControl.ParagraphSelect | This method can be used to select the specified paragraph.


Extended Properties, Methods and Events

In TX Text Control 22.0 the following properties, methods and events have been extended:

Properties

Property | Update Note
LoadSaveAttribute Property | Has been extended with the txDocumentLevelJavaScriptActions attribute to enable embedding of Javescript actions in PDF documents.


What's New in Version 21.0

The following provides a general list of features that have been added since Text Control version 20.0.

New Features

New Properties, Methods and Events

Extended Properties, Methods and Events


New Features

Text Control 21.0 provides the following new features:

Feature | Description
Find and Replace | The built-in find and replace dialogboxes have been extended with several new features. The search process is no longer limited to the main text, it can be continued in text frames and in headers and footers. A new option MatchWholeWord has been added to the dialogbox and to the Find method locating only instances of the search text which are whole words.
Table Programming | The new TableSelectCells method allows it to select a certain part of a table defined through two table cells.
Pasting data from the Clipboard | TX Text Control provides an interface that enables a programmer to change the default behaviour for pasting data from the clipboard. The new ClipboardFormats property and the new Paste method have been implemented to support this feature.
Sections and Pages | The new properties PageStart/SectionStart and PageLength/SectionLength have been added to get the information where a certain page or section begins and how many characters it contains. The methods PageSelect and SectionSelect can be used to select a certain page or section.
Resource Kit | The built-in Find, Replace and Color dialogboxes have been added to the resource kit and can be localized now.


New Properties, Methods and Events

In TX Text Control 21.0 the following new properties, methods and events have been added:

Properties

Property | Description
TXTextControl.TXTextControl.ClipboardFormats | Returns an array of Integer values specifying all the data formats which are currently available in the clipboard and which can be pasted into a TextControl document.
TXTextControl.TXTextControl.PageLength | Gets the number of characters of the page, including the page break character at the end of the page.
TXTextControl.TXTextControl.PageStart | Gets the number (one-based) of the page's first character.
TXTextControl.TXTextControl.SectionLength | Gets the number of characters in the section.
TXTextControl.TXTextControl.SectionStart | Gets the number (one-based) of the section's first character.

Methods

Method | Description
TXTextControl.TXTextControl.PageSelect | This method can be used to select the specified page.
TXTextControl.TXTextControl.Paste | Replaces the current selection in the Text Control with the contents of the Clipboard.
TXTextControl.TXTextControl.SectionSelect | This method can be used to select the specified section.
TXTextControl.TXTextControl.TableSelectCells | This method can be used to select a rectangular part of a table defined through two table cells.


Extended Properties, Methods and Events

In TX Text Control 21.0 the following properties, methods and events have been extended:

Properties

Property | Update Note
Find Method | The new option MatchWholeWord has been added.


What's New in Version 20.0

The following provides a general list of features that have been added since Text Control version 19.0.

New Features

New Properties, Methods and Events

Extended Properties, Methods and Events


New Features

Text Control 20.0 provides the following new features:

Feature | Description
Right to Left Support | Text Control supports right to left text rendering for languages such as Arabic or Hebrew. Each line in a document can be bidirectional, which means, that it can contain text parts written from left to right and text parts written from right to left. The text input position behind a left-to-right character is on its right side and the input position behind a right-to-left character is on its left side. In addition, a paragraph can be formatted from right to left, which means that the blocks of bidirectional text are ordered from right to left. The TextDirection property has been added to support this feature. The paragraph formatting dialog box has also been extended to enable an end-user to format a paragraph from right to left. A tabulator in a right-to-left paragraph is a distance from the document's right page margin. When a paragraph is justified, TextControl now supports the insertion of Arabic Kashida lines in addition to expanding spaces. The Justification property can be used to set the kind of justification for each paragraph. Both justification features can be combined. The horizontal ruler bar has been extended to show the horizontal origin in a right-to-left paragraph at the right page margin. In right to left text, the natural paragraph alignment and tabulator kind is right aligned. The new ChangeTextDirection method can be used to change the writing direction of one or more paragraphs. When the direction of a paragraph is changed this paragraph's alignment is toggled from left to right or from right to left. The alignment of centered and justified paragraphs is not changed. Left and right tabulators are also toggled.
Right to Left Application Design | To support a right to left application design, all TXTextControl controls have a RightToLeft property. A TXTextControl control then shows the vertical scrollbar at the left border and has a zoom origin at the top right corner. All built-in dialog boxes and context menus have a right-to-left design. The TXRulerBar control has a right-to-left ruler and the TXButtonBar and TXStatusBar controls show their buttons or text parts from right to left.
Multilingual documents | A piece of text can be formatted now for a specific language, which is used for spellchecking and hyphenation. A document can be multilingual, which means that multiple languages can be used in the same document. A new built-in dialog box available with the LocaleDialog method can be used to get or to set the language for a selection of text or for the current text input position. Programmatically this can be done with the the Locale property. All text filters have been adapted to support language settings in other text formats. The TXStatusBar control offers the new ShowLocale property to show the language at the text input position.
Button Bar | Additional predefined buttons have been added to the TXButtonBar control. The PosStrikethru, PosSubscript and PosSuperscript buttons have been added to set additional font attributes. The PosLeftToRight and PosRightToLeft buttons set the writing direction either left to right or right to left.


New Properties, Methods and Events

In TX Text Control 20.0 the following new properties, methods and events have been added:

Properties

Property | Description
TXTextControl.TXButtonBar.PosLeftToRight | Returns or sets the position of a button for setting the left to right writing direction.
TXTextControl.TXButtonBar.PosRightToLeft | Returns or sets the position of a button for setting the right to left writing direction.
TXTextControl.TXButtonBar.PosStrikethru | Returns or sets the position of a button for setting the strike through attribute.
TXTextControl.TXButtonBar.PosSubscript | Returns or sets the position of a button for setting text to subscript.
TXTextControl.TXButtonBar.PosSuperscript | Returns or sets the position of a button for setting text to superscript.
TXTextControl.TXButtonBar.RightToLeft | Returns or sets a value specifying whether the button bar's buttons are shown from right to left or from left to right.
TXTextControl.TXRulerBar.RightToLeft | Returns or sets a value specifying whether the ruler bar has its origin at the right or at the left border.
TXTextControl.TXStatusBar.RightToLeft | Returns or sets a value specifying whether the status bar's display areas are shown from right to left or from left to right.
TXTextControl.TXStatusBar.ShowLocale | Specifies whether the status bar shows the language of the text selection or the text input position.
TXTextControl.TXTextControl.Justification | Gets or sets the kind of justification in documents containing Arabic or Hebrew characters.
TXTextControl.TXTextControl.Locale | Specifies a language for the selected text.
TXTextControl.TXTextControl.RightToLeft | Returns or sets a value specifying whether the Text Control's vertical scrollbar is at the left or right border and whether the Text Control has a right or left zoom origin.
TXTextControl.TXTextControl.TextDirection | Specifies the writing direction.

Methods

Method | Description
TXTextControl.TXTextControl.ChangeTextDirection | Changes the text direction of all selected paragraphs.
TXTextControl.TXTextControl.LocaleDialog | Invokes the Text Control's built-in language dialog box and, after the user has closed the dialog box, specifies whether he has changed something.


Extended Properties, Methods and Events

In TX Text Control 20.0 the following properties, methods and events have been extended:

Properties

Property | Update Note
ParagraphDialog Method | The dialog box has been extended to support the TextDirection property.


What's New in Version 19.0

The following provides a general list of features that have been added since Text Control version 18.0.

New Features

New Properties, Methods and Events

Extended Properties, Methods and Events


New Features

Text Control 19.0 provides the following new features:

Feature | Description
Page Numbering | Text Control now supports additional features for showing page numbers. For each section in the document page numbers can either be continued from the previous section or can be restarted with a certain start number. The SectionRestartPageNumbering property has been implemented to support this feature. The new field type txFieldAllPages can be used to handle a text field which shows the number of pages contained in the document or section. Such a field can be defined with the FieldType property. A new built-in dialog box can be used to alter the formatting and numbering attributes of page number fields. It can be opened with the PageNumberDialog method.
Built-in Context Menus | Text Control now offers built-in context menus. Depending on the area where the right mouse button has been clicked, a menu with standard options for this area is shown. There is a menu for standard text formatting, a menu for inserting or editing headers and footers including altering page settings and a menu for handling images and text frames. Before a built-in context menu is opened, a ContextMenuOpening event occurs. When the Cancel parameter of this event is set to True, opening the menu is suppressed.
Headers and Footers | Text Control now supports different headers and footers for the even and odd pages of the whole document or of a single section. A document's section can either contain the same header or footer for all pages or different headers and footers for even and odd pages. All Header and Footer properties and methods have been extended with the txEvenHeader and txEvenFooter constants for the HeaderFooter parameter. Depending on whether an even header or footer has been defined, the txHeader and txFooter settings either specify the odd header or footer or the header or footer of both pages. The built-in SectionFormatDialog dialog box has been extended to enable an end-user to select different headers and footers for even and odd pages. When a header or footer is activated, a dividing line between the header or footer and the main text is displayed instead of a frame. The dividing line has a label indicating which type of header or footer (even, odd, first page) is activated. The HeaderFooterStyle property has been extended, so that the former activation styles are still possible. The DisplayColor property has been extended to support designing the colors of dividing lines and labels.
Tables | Text Control now has a built-in dialog box to insert tables. A user can specify the number of columns and rows and the column width. Further options define whether the table has a header and whether the table's rows can break across a page border. The new TableInsertDialog method can be called to open this dialog. Furthermore, the new TableCellSelect method can be used to select a part of a table: cell, row, column or the complete table. The new TableDelete method has been implemented to delete a complete table from the document.
Printing | The new PrintDialog method opens a built-in dialog box and then prints a document. The dialog can be used to select a printer, a range of pages and a number of copies.
Control Characters | Text Control now has a control character which shows the anchor position of an anchored object. Anchored objects are positioned relative to a paragraph. The anchor postion is shown left of this paragraph's first character. The anchor is shown only when an anchored object is selected. Additionally individual control characters can be shown permanently on the screen independently of the ControlChars property. The new PermanentControlChars property can be used to set this feature.


New Properties, Methods and Events

In TX Text Control 19.0 the following new properties, methods and events have been added:

Properties

Property | Description
TXTextControl.TXTextControl.PermanentControlChars | Gets or sets a value specifying which control characters are shown permanently on the screen.
TXTextControl.TXTextControl.SectionRestartPageNumbering | Returns or sets a value specifying whether page numbering is restarted at the beginning of a document section.

Methods

Method | Description
TXTextControl.TXTextControl.PageNumberDialog | This method opens a built-in dialog box to set formatting attributes for the specified pagenumber field.
TXTextControl.TXTextControl.PrintDialog | Opens the system printing dialog and prints a Text Control document as specified through the dialog.
TXTextControl.TXTextControl.TableCellSelect | This method can be used to select a table cell, a table row, a table column or a complete table.
TXTextControl.TXTextControl.TableDelete | This method can be used to delete a complete table from the document.
TXTextControl.TXTextControl.TableFromSelection | This method returns the table identifier of the currently selected table.
TXTextControl.TXTextControl.TableInsertDialog | This method opens a built-in dialog box which offers options to define a new table.

Events

Event | Description
TXTextControl.TXTextControl.ContextMenuOpening | Occurs before a built-in context menu is opened.


Extended Properties, Methods and Events

In TX Text Control 19.0 the following properties, methods and events have been extended:

Properties

Property | Update Note
HeaderFooter Property | Has been extended with the txEvenHeader and txEvenFooter constants to support different headers and footers on the even and the odd pages of a document.
HeaderFooterAtInputPos Property | Has been extended with the txEvenHeader and txEvenFooter constants.
HeaderFooterPosition Property | Has been extended with the txEvenHeader and txEvenFooter constants.
HeaderFooterActivate Method | Has been extended with the txEvenHeader and txEvenFooter constants.
HeaderFooterSelect Method | Has been extended with the txEvenHeader and txEvenFooter constants.
HeaderFooterActivated Event | Has been extended with the txEvenHeader and txEvenFooter constants.
HeaderFooterStyle Property | Has been extended with the txDividingLine setting.
DisplayColor Property | Has been extended with the txHeaderFooterLineColor and txHeaderFooterLabelColor index values.
FieldNext Property | Has been extended to support fields which have the type txFieldAllPages.
FieldType Property | Has been extended to define a field which has the type txFieldAllPages.
FieldTypeData Property | Has been extended to define the data of a field which has the type txFieldAllPages.


What's New in Version 18.0

The following provides a general list of features that have been added since TX Text Control version 17.0.

New Features and Update Notes

New Properties, Methods and Events

Extended Properties, Methods and Events


New Features and Update Notes

TX Text Control 18.0 provides the following new features:

New Features

Feature | Description
Z-Order | Text Control now offers a z-order of all images, text frames and OLE objects which are inserted in the text. All of these objects can be either in front of the text or behind the text and the z-order among these objects can be changed. The ObjectTextflow property has been extended to support objects in front and behind the text. Depending on these modes either the text overwrites the object or the object overwrites the text. The z-order can be changed with the ObjectChangeZOrder method. With this method the image, text frame or OLE object can be moved up or down one plane or it can be moved to the topmost or to the bottom most position. Objects inserted inline have always a z-order of zero.
Transparent Text Frames | Text frames can be transparent, so that images and other text frames behind a transparent text frame are visible. Transparency can be set as a value from 0 to 255 with the ObjectTransparency property. Zero means opaque and 255 means completely transparent.
Images | TX Text Control supports now the EMF image format (Windows Enhanced Metafile). The EMF and WMF image formats are handled internally without an image filter. The WMF image filter is no longer necessary.
New Status Bar Design | The TXStatusBar offers a new background style with a vertical color gradient and separator lines between the display parts. Furthermore a track bar has been added to set the zooming factor of a Text Control. All colors depend either on the Windows themes or can be user-defined with the TXStatusBar.DisplayColor property. The new txVerticalColorScheme style can be set with the TXStatusBar.Appearance property.


New Properties, Methods and Events

In TX Text Control 18.0 the following new properties, methods and events have been added:

Properties

Property | Description
TXTextControl.TXStatusBar.ShowZoomTrackBar | Specifies whether the status bar shows a track bar instead of a simple number to show and to set the zooming factor.
TXTextControl.TXTextControl.ObjectTransparency | Specifies the object's transparency.

Methods

Method | Description
TXTextControl.TXTextControl.ObjectChangeZOrder | Changes the z-order of an image, text frame or OLE object.


Extended Properties, Methods and Events

In TX Text Control 18.0 the following properties, methods and events have been extended:

Properties

Property | Update Note
ObjectTextflow Property | Has been extended with the values 1 (the object overwrites the text) and 4 (the text overwrites the object).
TXStatusBar.Appearance Property | Has been extended with the txVerticalColorScheme setting.


What's New in Version 17.0

The following provides a general list of features that have been added since TX Text Control version 16.0.

New Features and Update Notes

New Properties, Methods and Events

Extended Properties, Methods and Events


New Features and Update Notes

TX Text Control 17.0 provides the following new features:

New Features

Feature | Description
Text Selections | Text selections in tables have been extended so that it is now possible to select table columns and rectangular areas of table cells. Table columns can be formatted and copied to the clipboard. Text selections are now displayed with a transparent blue bitmap. The new SelectionViewMode property can be used to furthermore display selections with the classic selection view mode.
Merged Table Cells | Table cells can be merged with the new TableMergeCells method. The method merges all selected cells to a single cell which has the same width and the same content as the original cells. The new TableSplitCells method can be used to split previously merged cells. Table cells can only be merged, if more than one cell is selected, and if the selection is in a single table. The TableCanMergeCells and TableCanSplitCells properties can be used to check whether cells can be merged or split.
Table Cell Data | For each table cell any string data can be stored associated with the cell. The new TableCellData property can be used to get or to set this data. The data is stored only, when the TXTextControl file format is used.
Colored Table Lines | Table lines can be colored. Each line of a table cell can have a different color. All text filters and the TXTextControl file format have been extended so that this feature can be exchanged with other applications. The TableCellAttribute property has been extended with the txTableCellLeftBorderColor, txTableCellTopBorderColor, txTableCellRightBorderColor and txTableCellBottomBorderColor settings to set these attributes programmatically. Colored table lines can also be set with the built-in dialogbox for setting table attributes.
Page Borders | Borders can now be defined for each page of a document section. A page border can have a top, left, right or bottom line or a combination of these lines. The line width and the color can be defined for each line separately. For each line a distance can be specified, which is either a distance to the edge of the page or to the text. The page border can surround the text including page headers and footers or only the text of the page. The border can be defined for the first page, for all pages or beginning with the second page. The new PageBorderAttribute property can be used to define a page border programmatically. The dialog box for setting section attributes has also been extended so that an end-user can define a page border.
Digital Signatures | PDF files can be saved digitally signed with an X.509 certificate. The LoadSaveAttribute property has been extended with the txCertificateFileName, txCertificatePassword and txTimeServerURL attributes to set a certificate for a saving process.
HTML Format | The TX Text Control HTML import filter now uses the parsing rules described in the W3C specification of HTML5 (http://www.w3.org/TR/html5/Overview.html#parsing).


New Properties, Methods and Events

In TX Text Control 17.0 the following new properties, methods and events have been added:

Properties

Property | Description
TXTextControl.TXTextControl.PageBorderAttribute | This property returns or sets page border attributes for the whole document or for a document's section.
TXTextControl.TXTextControl.SelectionViewMode | Specifies whether text selections are displayed with a transparent bitmap or through inverting the text.
TXTextControl.TXTextControl.TableCanMergeCells | This property provides information about whether table cells can be merged.
TXTextControl.TXTextControl.TableCanSplitCells | This property provides information about whether table cells can be split.
TXTextControl.TXTextControl.TableCellData | Returns or sets a string associated with the specified table cell.

Methods

Method | Description
TXTextControl.TXTextControl.TableMergeCells | This method merges all selected table cells.
TXTextControl.TXTextControl.TableSplitCells | This method splits all selected table cells.


Extended Properties, Methods and Events

In TX Text Control 17.0 the following properties, methods and events have been extended:

Properties

Property | Update Note
TableCellAttribute Property | Has been extended with the txTableCellLeftBorderColor, txTableCellRightBorderColor, txTableCellTopBorderColor and txTableCellBottomBorderColor attributes to get or to set the colors of a table cell's border lines.
LoadSaveAttribute Property | Has been extended with the txCertificateFileName, txCertificatePassword and txTimeServerURL attributes to support signing of PDF files with an X.509 certificate.


What's New in Version 16.0

The following provides a general list of features that have been added since TX Text Control version 16.0.

New Features and Update Notes

New Properties, Methods and Events

Extended Properties, Methods and Events


New Features and Update Notes

TX Text Control 16.0 provides several new features described in the following table.

New Features

Feature | Description
Table Headers | A header can be defined for each table in a TX Text Control document. A table header consists of one or more table rows, which are repeated on top of each page when a single table extends over several pages. The table attributes dialog box has been extended so that an end-user can define a table header. The txTableCellIsHeader attribute of the TableCellAttribute property can be used to set this feature programmatically. If a header is defined for a table, which extends over several columns of a page, the header is displayed on top of each column.
Page Images | TX Text Control provides an image for each page of a document, which can be used with the Picture property of a Form object, PictureBox control or Image control. The new PageImage property can be used to get the image.
Extended User Interface | New buttons have been added to the TXButtonBar, which can be used to grow and shrink the font sizes of all selected fonts and to increase or decrease the left indent of all the selected paragraphs. Corresponding methods have been added to the TXTextControl to provide this functionality from programming code: GrowFont, ShrinkFont, IncreaseIndent and DecreaseIndent.
Spell checking | TX Text Control provides a new spell checker interface so that every spell checker can easily be used with a TXTextControl. Every time the text of a document changes, a SpellCheckText event is raised. The event's data contains the text that must be checked on misspelled words. The event's data can receive an array of start and end positions to inform TextControl about the positions of all misspelled words. These words are underlined with a red zigzag line. Spell checking is only active, if the EnableSpellChecking property has been set to True. A programmer has access to all misspelled words in the document through the following new properties. The MisspelledWords property informs on the total number of misspelled words, the MisspelledWordStart and MisspelledWordLength properties return the position and length of a misspelled word. The MisspelledWordAtInputPos property returns the number of the misspelled word at the current text input position. To correct the misspelled text the MisspelledWordDelete method can be used.


New Properties, Methods and Events

In TX Text Control 16.0 the following new properties, methods and events have been added:

Properties

Property | Description
TXTextControl.TXButtonBar.PosDecreaseIndent | Returns or sets the position of a button which decreases the left indent of all selected paragraphs.
TXTextControl.TXButtonBar.PosGrowFont | Returns or sets the position of a button which grows the font sizes of all selected fonts.
TXTextControl.TXButtonBar.PosIncreaseIndent | Returns or sets the position of a button which increases the left indent of all selected paragraphs.
TXTextControl.TXButtonBar.PosShrinkFont | Returns or sets the position of a button which shrinks the font sizes of all selected fonts.
TXTextControl.TXTextControl.EnableSpellChecking | Gets or sets a value indicating whether spell checking is active or not.
TXTextControl.TXTextControl.MisspelledWordAtInputPos | Gets the number of the misspelled word at the current text input position.
TXTextControl.TXTextControl.MisspelledWordLength | Gets the length of the misspelled word with the specified number.
TXTextControl.TXTextControl.MisspelledWords | Gets the current number of misspelled words.
TXTextControl.TXTextControl.MisspelledWordStart | Gets the zero-based position of the misspelled word with the specified number.
TXTextControl.TXTextControl.PageImage | Returns an image of the specified page which can be used with the Picture property of a Form object, PictureBox control or Image control.

Methods

Method | Description
TXTextControl.TXTextControl.DecreaseIndent | Decreases the left indent of all paragraphs contained in the current text selection.
TXTextControl.TXTextControl.GrowFont | Increases the font size of each font contained in the current text selection.
TXTextControl.TXTextControl.IncreaseIndent | Increases the left indent of all paragraphs contained in the current text selection.
TXTextControl.TXTextControl.MisspelledWordDelete | Removes the specified misspelled word from a Text Control document.
TXTextControl.TXTextControl.ShrinkFont | Decreases the font size of each font contained in the current text selection.

Events

Event | Description
TXTextControl.TXTextControl.SpellCheckText | Occurs, if the document's text has been altered and the spelling of the new text must be checked.


Extended Properties, Methods and Events

In TX Text Control 16.0 the following properties, methods and events have been extended:

Properties

Property | Update Note
TableCellAttribute Property | Has been extended with the txTableCellIsHeader attribute to get or to set a value indicating whether the table cell belongs to the table's header.


What's New in Version 15.1

The following provides a general list of features that have been added since TX Text Control version 15.0.

New Features and Update Notes

New Properties, Methods and Events

Extended Properties, Methods and Events


New Features and Update Notes

TX Text Control 15.1 provides several new features described in the following table.

New Features

Feature | Description
Images, Text frames and OLE Objects | Images, text frames and OLE objects can have an identifier and/or a name, which can be set with the ObjectUserId and ObjectName property. The ObjectGetFromUserId and the ObjectGetFromName methods can be used to look for an image, text frame or OLE object with a given id or name. An ObjectInsertionMode property has been added that can change the object's behaviour in the text programmatically after the object has been inserted or loaded. The ObjectTextflow property has been extended from read only to changeable. To get or to set an object's position, the ObjectPosX and the ObjectPosY property are available now.
Drag&Drop | A Text Control has now a built-in Drag&Drop functionality. The AllowDrop property installs the control as a target for data the user drags onto it and the AllowDrag property enables the control as a source of a Drag&Drop operation. A Text Control accepts text formatted as Rich Text Format, HTML Format or plain text and images formatted as device dependent or device independent bitmaps, TIFF images or Windows metafiles. If the user moves the cursor over the control, it shows the insertion point where the data is inserted with a non-blinking caret. By default text is moved through Drag&Drop, pressing the CTRL key, text is copied. The ESC key cancels an operation.
Display Colors | The colors which TX Text Control uses for the display elements of the tool bars and the text control can now be changed. By default the controls have a fixed color table for the standard Windows themes. Supported standard themes are the Windows XP standard theme: luna.msstyles (colors: Blue (NormalColor), Olive Green (Homestead), Silver (Metallic)), the Windows XP Media Center Edition standard theme: royale.msstyles (colors: NormalColor and Royale) and the Windows Vista and Windows 7 standard theme: aero.msstyles(colors: NormalColor). For all other themes the default colors depend on theme colors. If no theme is selected, the default colors depend on system colors. The TXTextControl.DisplayColor, TXButtonBar.DisplayColor, TXRulerBar.DisplayColor and TXStatusBar.DisplayColor properties can be used to individually design the controls' colors.
Saving Images | With two new attributes of the LoadSaveAttribute property, txImageExportFormat and txImageSaveMode, all images of the document can be exported in a certain format and saving mode.
Unlimited Zoom Factor | The ZoomFactor of a Text Control is no longer limited to 400 percent, when the ViewMode property has been set to 0 - Normal View or 2 - Page View. For the other modes the zoom factor is furthermore limited to 400 percent.
Mouse Wheel | The functionality of the mouse wheel has been extended. Pressing the SHIFT key scrolls the visual part of the document horizontally and pressing the CONTROL key zooms the document.


New Properties, Methods and Events

In TX Text Control 15.1 the following new properties, methods and events have been added:

Properties

Property | Description
TXTextControl.TXButtonBar.DisplayColor | This property gets or sets the display colors of a button bar.
TXTextControl.TXRulerBar.DisplayColor | This property gets or sets the display colors of a ruler bar.
TXTextControl.TXStatusBar.DisplayColor | This property gets or sets the display colors of a status bar.
TXTextControl.TXTextControl.AllowDrag | Gets or sets a value indicating whether the control can be a source of a Drag&Drop operation.
TXTextControl.TXTextControl.AllowDrop | Gets or sets a value indicating whether the control can accept data that the user drags onto it.
TXTextControl.TXTextControl.DisplayColor | This property gets or sets the display colors of a TextControl.
TXTextControl.TXTextControl.ObjectInsertionMode | Gets or sets an image's, text frame's or OLE object's formatting behaviour.
TXTextControl.TXTextControl.ObjectName | Defines a name for an image, text frame or OLE object.
TXTextControl.TXTextControl.ObjectPosX | Gets or sets the imags's, text frame's or OLE object's horizontal position, in twips.
TXTextControl.TXTextControl.ObjectPosY | Gets or sets the image's, text frame's or OLE object's vertical position, in twips.
TXTextControl.TXTextControl.ObjectUserId | Defines a user-defined identifier for an image, text frame or OLE object.

Methods

Method | Description
TXTextControl.TXTextControl.ObjectGetFromName | Looks for the object with the specified name.
TXTextControl.TXTextControl.ObjectGetFromUserId | Looks for the object with the specified user identifier.


Extended Properties, Methods and Events

In TX Text Control 15.1 the following properties, methods and events have been extended:

Properties

Property | Update Note
ObjectTextFlow Property | Has been extended from read only to changeable.
ImageSaveMode Property | Has been extended with an automatic mode.


What's New in Version 15.0

The following provides a general list of features that have been added since TX Text Control version 14.0.

New Features and Update Notes

New Properties, Methods and Events

Extended Properties, Methods and Events


New Features and Update Notes

TX Text Control 15.0 provides several new features described in the following table.

New Features

Feature | Description
Arranging Text in Columns | The text of a document can now be arranged in columns. The number of columns is an attribute of a document section, so that different numbers of columns can be used in the same document. Depending on where a section starts, the number of columns can change everywhere on a page. Further attributes are the widths of the columns and the distance between the columns that can individually be changed. In an automatic mode the width of the columns are calculated from the page width, which is the default setting. An end-user can use an additional tab of the Page Setup dialog box, available through the SectionFormatDialog method to make column settings and the TX TextControl ruler bar shows the columns' widths and the distances between the columns. The SHIFT-CTRL-RETURN keyboard key combination inserts a break character which forces that text is continued in the next column. The Columns and the ColumnDistance properties can be used to set columns programmatically. Columns set with these properties are automatically adapted to the page width. To set columns with different widths and distances, use the ColumnWidthsAndDistances property.
Archiving Documents in PDF/A Format A document can now be archived in PDF/A format. TX Text Control supports the ISO Standard PDF/A-1 Level B. In addition to standard PDF the following data is saved:
  • only embeddable fonts are saved
  • document data like title or author is saved in XMP format
  • Additional font data is stored specifying which characters of a font are used
  • A color profile is saved
  • Links to start other applications are not allowed
  • Access restrictions are not allowed. The txDocAccessPermissions attribute of the LoadSaveAttribute property is ignored.
The Format parameter of the Save methods accepts a new value thus this format can be saved. Before saving PDF/A the new FontSettings property must be set to Embeddable Fonts only, so that the document contains only embeddable fonts.
Structured Numbered Lists | TX Text Control supports now structured numbered lists. A structured list displays for each level its list number and additionally the list numbers of the higher levels. The text in front and behind the list number is also displayed for all higher levels. The text in front and behind the list number can now be longer than one character. The ListType property has been extended with the txListStructured setting to support such lists. The NumberingAttribute property has been extended with the txNumberingPostText and txNumberingPreText attributes to support text longer than one character in front and behind the list numbers. The TX Text Control Button Bar provides a new button for setting a structured numbered list. The PosListStructured property has been added to determine the position of this button.

Update Notes

Feature | Update Note
NumberingAttribute Property | The txNumberingPostText and txNumberingPreText attributes replace the txNumberingPostChar and txNumberingPreChar attributes to support longer text in front and behind the numbers of numbered lists. Although still implemented for compatibility a new application should not use the older versions.


New Properties, Methods and Events

In TX Text Control 15.0 the following new properties, methods and events have been added:

Properties

Property | Description
TXTextControl.TXTextControl.ColumnDistance | Sets the distance, in twips, between the columns on a page for the whole document or for a document's section.
TXTextControl.TXTextControl.ColumnLineColor | Returns or sets the color of a dividing line between two page columns, either for the whole document or for a certain section.
TXTextControl.TXTextControl.ColumnLineWidth | Returns or sets the width, in twips, of a dividing line between two page columns, either for the whole document or for a certain section.
TXTextControl.TXTextControl.Columns | Returns or sets the number of columns on a page for the whole document or for a document's section.
TXTextControl.TXTextControl.ColumnWidthsAndDistances | Returns or sets the number of columns on a page including its widths and distances for the whole document or for a document's section.
TXTextControl.TXTextControl.FontSettings | Determines which kind of fonts can be used in a document.


Extended Properties, Methods and Events

In TX Text Control 15.0 the following properties, methods and events have been extended:

Properties

Property | Update Note
ListType Property | Has been extended with the txListStructured setting to support the programatically setting of a structured list.
NumberingAttribute Property | Has been extended with the txNumberingPostText and txNumberingPreText attributes to support text in front and behind the number of a numbered list.
Style.ListType Property | Has been extended with the txListStructured setting to support the programatically setting of a structured list with a formatting style.
Style.NumberingAttribute Property | Has been extended with the txNumberingPostText and txNumberingPreText attributes to support text in front and behind the number of a numbered list with a formatting style.
SectionFormatDialog Method | Has been extended with a third tab for setting the attributes of columns.


What's New in Version 14.0

The following provides a general list of features that have been added since TX Text Control version 13.0.

New Features and Update Notes

New Properties, Methods and Events

Extended Properties, Methods and Events


New Features and Update Notes

TX Text Control 14.0 provides several new features described in the following table.

New Features

Feature | Description
Section Formatting | A document can be split into several sections to enable different page sizes and margins and different headers and footers in the same document. An end-user can use the new Page Setup dialog box available through the SectionFormatDialog method. All section attributes and headers and footers can be set either for a single section or for the complete document. The SectionCurrent property has been implemented to specify a part of the document when the attributes of a section are to be altered from programming code. This property can be used in conjunction with the PageWidth, PageHeight, PageMarginL, PageMarginT, PageMarginR, and PageMarginB properties. The TXStatusBar control has been extended to show the section number at the text input position. Additionally, it shows the number of pages and the number of sections contained in the document.
Headers and Footers | The contents and the alignment of headers and footers can be different for each section. Also each section can have a special header and a special footer for the section's first page. If a section does not need its own header or footer, its header or footer can be connected with the header or footer of the previous section. The HeaderFooterConnectedToPrevious property implements this feature. The SectionCurrent property in conjunction with all Headerxxx properties an methods can be used to alter headers and footers for a single section or the current input section.
WordprocessingML Format | TX Text Control supports the WordprocessingML part of the Microsoft Office Open XML format. This format is a ZIP compressed XML format for word processing and is used as standard format of Microsoft Word. A TextControl can load and save files (.docx extension) and blocks of memory containing documents formatted with this format. The Format parameter of the Load and Save methods accept a new value to load and save this format.
Import and Export of Microsoft Word Fields | TX Text Control now supports the import and export of Microsoft Word fields contained in Microsoft Word and RTF documents. The arguments and switches of these fields are available through the FieldTypeData property, if the field is of the type txFieldMSWord. This field type only provides an interface to retrieve and change the data and parameters of such fields. The field logic itself is not implemented. Before loading a document, the txLoadMSWordFields attribute of the LoadSaveAttributes property must be set to true. The txMSWordFieldTypeNames attribute can be used to select particular types of fields. The FieldNext method has been expanded to enable iteration through all such fields in the document.
Import and Export of Heiler HighEdit Fields | TX Text Control also supports the import and export of Heiler HighEdit fields contained in RTF documents. The names of these fields are available through the FieldTypeData property, if the field is of the type txFieldHighEdit. Before loading a document, the txLoadHighEditFields attribute of the LoadSaveAttribute property must be set to true. The FieldNext method has been expanded to enable iteration through all such fields in the document.
Background Printing | Additional contents such as images or watermarks can be printed on a page of a document. A TXTextControl control prints transparently on top of some output that has been added through an application before the PrintPage method is called.

Update Notes

Feature | Update Note
HeaderFooterSelect Method | In previous versions of TX Text Control, it was possible (although not in accordance with the manual) to deselect a header or footer using txMain as a parameter. This was invalid before, but did not cause an error. In version 14, error handling has been improved, so that now a value of 0 (automatic mode) must be used to deselect a header or footer.
HeaderFooterSelect Method | In previous versions of TX Text Control, it was also possible to select a footer while a header was selected. In version 14 a header or footer can only be selected when in Automatic Mode. Please refer to the technical article Programming Headers and Footers for further details.
Sections and Page Settings | Before version 14, properties like PageHeight and PageWidth always applied to an entire document. In version 14, each section of a document can have its own page settings. When using one of the page related properties without previously selecting a section, please keep in mind that all sections are affected.
Page Orientation, Portrait vs. Landscape | The following incompatibility can occur when using TX Text Control's internal format. Other formats, including DOC, RTF and HTML are not affected. In previous versions of TX Text Control, Landscape orientation was simulated by simply exchanging a document's widht and height. The new Landscape mode of Version 14 will not recognize this simulated landscape mode, but will display a document that was formatted this way as having portrait orientation.


New Properties, Methods and Events

In TX Text Control 14.0 the following new properties, methods and events have been added:

Properties

Property | Description
TXTextControl.TXStatusBar.ShowColumn | Specifies whether the status bar shows the column number of the current text input position.
TXTextControl.TXStatusBar.ShowLine | Specifies whether the status bar shows the line number of the current text input position.
TXTextControl.TXStatusBar.ShowPage | Specifies whether the status bar shows the page number of the current text input position.
TXTextControl.TXStatusBar.ShowPageCounter | Specifies whether the status bar shows the number of pages in the document.
TXTextControl.TXStatusBar.ShowSection | Specifies whether the status bar shows the section number of the current text input position.
TXTextControl.TXStatusBar.ShowSectionCounter | Specifies whether the status bar shows the number of sections in the document.
TXTextControl.TXStatusBar.TextPageCounter | Returns or sets the text which appears in front of the page counter.
TXTextControl.TXStatusBar.TextSection | Returns or sets the text which appears in the Section field in front of the section number.
TXTextControl.TXStatusBar.TextSectionCounter | Returns or sets the text which appears in front of the section counter.
TXTextControl.TXTextControl.HeaderFooterConnectedToPrevious | This property returns or sets a value specifying whether a header or footer is connected with the header or footer of the previous section.
TXTextControl.TXTextControl.PageOrientation | Returns or sets the page orientation, portrait or landscape.
TXTextControl.TXTextControl.PageViewStyle | Defines the kind of view to display the page background.
TXTextControl.TXTextControl.SectionAtInputPos | Returns the number of the section containing the current text input position.
TXTextControl.TXTextControl.SectionBreakKind | Returns or sets the kind of the section break the section starts with.
TXTextControl.TXTextControl.SectionCount | Returns the number of sections, the document contains.
TXTextControl.TXTextControl.SectionCurrent | Returns or sets the section number for the following properties and methods: PageWidth, PageHeight, PageMarginL, PageMarginT, PageMarginR, PageMarginB, PageOrientation, HeaderFooter, HeaderFooterActivate, HeaderFooterSelect, HeaderFooterPosition, HeaderFooterConnectedToPrevious, Columns, PageBorderAttribute, ColumnDistance, ColumnLineWidth, ColumnLineColor, ColumnWidthsAndDistances, SectionRestartPageNumbering, and SectionBreakKind.

Methods

Method | Description
TXTextControl.TXTextControl.SectionFormatDialog | This method invokes the built-in dialog box to set page settings and to design the headers and footers either for the whole document or for a single section.
TXTextControl.TXTextControl.SectionInsert | Inserts a section break at the text input position or at a specified position.

Events

Event | Description
TXTextControl.TXTextControl.PageChanged | Occurs when the text input position has been moved to another page.
TXTextControl.TXTextControl.SectionChanged | Occurs when the text input position has been moved to another section.


Extended Properties, Methods and Events

In TX Text Control 14.0 the following properties, methods and events have been extended:

Properties

Property | Update Note
HeaderFooter Property | Has been extended to support sections. The SectionCurrent property specifies a section number.
HeaderFooterPosition Property | Has been extended to support sections. The SectionCurrent property determines the section the header or footer belongs to.
HeaderFooterAtInputPos Property | Has been extended to support sections. The SectionCurrent property receives the number of the section the header or footer belongs to.
PageHeight Property | Has been extended to support sections. The SectionCurrent property specifies a section number.
PageMarginL Property | Has been extended to support sections. The SectionCurrent property specifies a section number.
PageMarginT Property | Has been extended to support sections. The SectionCurrent property specifies a section number.
PageMarginR Property | Has been extended to support sections. The SectionCurrent property specifies a section number.
PageMarginB Property | Has been extended to support sections. The SectionCurrent property specifies a section number.
PageWidth Property | Has been extended to support sections. The SectionCurrent property specifies a section number.
LoadSaveAttribute Property | Has been extended with the txLoadMSWordFields and txLoadHighEditFields attributes to support Microsoft Word and Heiler HighEdit fields contained in Microsoft Word and RTF documents.
FieldType Property | Has been extended with the txFieldMSWord and txFieldHighEdit field types to support Microsoft Word and Heiler HighEdit fields contained in Microsoft Word and RTF documents.
FieldTypeData Property | Has been extended with the txFieldMSWord and txFieldHighEdit field types to support Microsoft Word and Heiler HighEdit fields contained in Microsoft Word and RTF documents.

Methods

Method | Update Note
HeaderFooterActivate Method | Has been extended to support sections. The SectionCurrent property determines the section the header or footer of which is activated.
HeaderFooterSelect Method | Has been extended to support sections. The SectionCurrent property determines the section the header or footer of which is selected.
FieldNext Method | Has been extended to support fields of the types txFieldMSWord and txFieldHighEdit.

Events

Method | Update Note
HeaderFooterActivated Event | Has been extended to support sections. The SectionCurrent property receives the number of the section to which the header or footer belongs.
HeaderFooterDeactivated Event | Has been extended to support sections. The SectionCurrent property receives the number of the section to which the header or footer belongs.


What's New in Version 13.0

The following provides a general list of features that have been added since TX Text Control version 12.0.

New Features and Update Notes

New Properties, Methods and Events


New Features and Update Notes

TX Text Control 13.0 provides the several new features all described in the following tables.

New Features

Feature | Description
Vertical Ruler Bar | TX Text Control now offers a vertical ruler bar with which the user can set the top and the bottom page margin, the position and the height of headers and footers and the height of table cells. The TXRulerBar control has an additional Direction property to switch the bar from horizontal to vertical. The vertical ruler bar is connected to a TXTextControl control with the VerticalRulerHandle property.
Tool Bar Design | All tool bars now support the Windows color schemes that can be selected through the system settings. The buttons and the background of the button bar has a light to dark variation in color and the ruler bar and status bar have a unified background color depending on the system's color scheme. The new design can be selected through the txColorScheme setting of the TXButtonBar.Appearance, TXButtonBar.Style, TXRulerBar.Appearance and TXStatusBar.Appearance properties.
Hypertext Links in PDF Documents | TX Text Control now supports hypertext links when a document is exported in Adobe PDF format. All text fields in a TX Text Control document which are of the special types txFieldExternalLink, txFieldInternalLink or txFieldLinkTarget are converted to an appropriate link or target in the Adobe PDF document.
Paragraph Formatting | TX Text Control offers a new dialog box for setting paragraph attributes. Additional features have been added to set paragraph frames and textflow options like Keep with next paragraph, Keep lines of paragraph together, Page break before paragraph and Widow/Orphan control. These features are also available through the KeepWithNext, KeepLinesTogether, PageBreakBefore and WidowOrphanLines properties of the TXTextControl control and the Style object.
Clipboard Import | TX Text Control now imports HTML formatted text from the clipboard.
Hypertext Targets | The new property TXTextControl.FieldLinkTargetMarkers can be used to make hypertext targets visible.
Text Fields and Hypertext Links | the new TXTextControl.FieldSetInputPos method determines the exact input position at the beginning or at the end of a marked text field.


New Properties, Methods and Events

In TX Text Control 13.0 the following new properties, methods and events have been added:

Properties

Property | Description
TXTextControl.Style.KeepLinesTogether | Gets or sets a value indicating whether a page break is allowed within a paragraph.
TXTextControl.Style.KeepWithNext | If this property is set to true, a paragraph with this formatting style is displayed on the same page as its following paragraph.
TXTextControl.Style.PageBreakBefore | If this property is set to true, a paragraph with this formatting style is always displayed on top of a page.
TXTextControl.Style.WidowOrphanLines | Gets or sets the number of lines for widow/orphan control.
TXTextControl.TXRulerBar.Direction | Gets or sets a value specifying the direction of the ruler bar in the document.
TXTextControl.TXRulerBar.EnablePageMargins | Enables or disables the setting of page margins.
TXTextControl.TXStatusBar.Appearance | Returns or sets the paint style of a status bar.
TXTextControl.TXTextControl.FieldLinkTargetMarkers | Gets or sets a value indicating that markers for hypertext targets are shown or not.
TXTextControl.TXTextControl.KeepLinesTogether | Gets or sets a value indicating whether a page break is allowed within a paragraph.
TXTextControl.TXTextControl.KeepWithNext | If this property is set to true for a paragraph, it is displayed on the same page as its following paragraph.
TXTextControl.TXTextControl.PageBreakBefore | If this property is set to true for a paragraph, it is always displayed on top of a page.
TXTextControl.TXTextControl.VerticalRulerHandle | Specifies the ruler control to be used as vertical ruler with a Text Control.
TXTextControl.TXTextControl.WidowOrphanLines | Gets or sets the number of lines for widow/orphan control.

Methods

Method | Description
TXTextControl.TXTextControl.FieldSetInputPos | If the current text input position is a position at the beginning or at the end of a marked text field with a doubled input position, this method can be used to define whether the position is inside or outside the field.


What's New in Version 12.0

The following provides a general list of features that have been added since TX Text Control version 11.0.

New Features and Update Notes

New Properties, Methods and Events


New Features and Update Notes

TX Text Control 12.0 provides the several new features all described in the following tables.

New Features

Feature | Description
Anchored Images | In prior versions of TX Text Control images and OLE objects can either be inserted like a single character or geometrically positioned relative to the complete document. Now a third method is supported that is called 'anchored to a paragraph'. This means that the text still flows around the image or OLE object but the geometrical position is relative to the paragraph to which it is anchored. If other text is inserted in front of this paragraph the object is moved with the text. The new methods ImageInsert and ObjectInsert have been implemented to insert such an image or OLE object in the text. All properties that deal with images and OLE object have been enhanced so that the programmer can manipulate anchored images and OLE objects.
Text Frames | TX Text Control now supports text frames. A text frame is a rectangle that can be filled with text by an end-user and that can be edited like the main text. A text frame can be positioned like an image, either geometrically or as a single character. Geometrically its position can either be relative to a paragraph to which it is anchored or relative to a document's page. Three methods have been implemented to insert text frames: TextFrameInsert inserts a text frame that is anchored to a paragraph and that is moved with the text. TextFrameInsertAsChar inserts a textframe that is handled in the document like a single character and TextFrameInsertFixed inserts a text frame that is aligned at a fixed page position. A text frame is fully programable from program code. Every Text Control property or method can be routed to a text frame. The new method TextFrameSelect determines whether a certain Text Control property manipulates a text frame or the main text. Further properties set text frame attributes like the width of the border line, internal margins and the background color.
Image and Text Frame Attributes | A new built-in dialog box has been added to allow attributes of images and text frames to be changed. It can be used to set general attributes like size, text wrapping, scaling and text distances. Furthermore, it has a special tab to set filename, format, resolution and compression for image export, and a special tab to set background color and frame attributes for text frames. The new ObjectAttrDialog method opens this dialog.
Image and Text Frame Mouse Interface | A new mouse interface for integrated objects like images and text frames is available. Objects can be moved and sized in every insertion mode. A selection frame with size handles shows the current selection state.
Table Formatting | Additional features have been added to give end-users more control of how tables are formatted at page breaks. A forced page break can be inserted in a table at each character position using the CTRL+ENTER key combination. This moves the complete table row to the next page. Additionally, a table row can receive a new formatting attribute determining that the complete row is moved to the next page, if at least one line of text is on the next page. Furthermore, a height can be specified which is the table row's minimum height. If more text is inserted, the height grows as necessary. All of these features can be set with the built-in dialog box for setting table attributes and through code using the TableCellAttribute property.

Update Notes

Property/Method/Event | Update Note
ObjectCurrent Property | Has been extended to support text frames, and anchored images and OLE objects.
ObjectNext Property | Has been extended to support text frames, and anchored images and OLE objects.


New Properties, Methods and Events

In TX Text Control 12.0 the following new properties, methods and events have been added:

Properties

Property | Description
TXTextControl.TXTextControl.HeaderFooterAtInputPos | Returns which header or footer owns the current text input position.
TXTextControl.TXTextControl.ObjectHeight | Returns or sets the natural height, in twips, of an image, text frame or OLE object.
TXTextControl.TXTextControl.ObjectWidth | Returns or sets the natural width, in twips, of an image, text frame or OLE object.
TXTextControl.TXTextControl.TextFrameBackColor | Returns or sets the background color of a text frame.
TXTextControl.TXTextControl.TextFrameBorderWidth | Specifies the width, in twips, of a text frame's border line.
TXTextControl.TXTextControl.TextFrameInternalMargin | Specifies the distance (in twips) between a text frame's border line and the text.
TXTextControl.TXTextControl.TextFrameMarkerLines | This property determines whether or not marker lines for text frames are visible.

Methods

Method | Description
TXTextControl.TXTextControl.ImageInsert | This method inserts a new image anchored to a paragraph.
TXTextControl.TXTextControl.ImageInsertAsChar | This method inserts a new image which is then handled like a single character in the text.
TXTextControl.TXTextControl.ImageInsertFixed | This method inserts a new image at a fixed geometrical position.
TXTextControl.TXTextControl.ObjectAttrDialog | This method invokes the built-in dialog box for setting attributes of images, text frames and OLE objects.
TXTextControl.TXTextControl.ObjectGetSelected | This method returns the identifier of the currently selected object.
TXTextControl.TXTextControl.ObjectInsert | This method inserts a new OLE object or other control anchored to a paragraph.
TXTextControl.TXTextControl.TextFrameInsert | This method inserts a new text frame anchored to a paragraph.
TXTextControl.TXTextControl.TextFrameInsertAsChar | This method inserts a new text frame, which is then handled as a single character in the text.
TXTextControl.TXTextControl.TextFrameInsertFixed | This method inserts a new text frame at a fixed geometrical position.
TXTextControl.TXTextControl.TextFrameSelect | This method determines whether a certain Text Control property or method manipulates a text frame or the main text.

Events

Event | Description
TXTextControl.TXTextControl.ObjectRightClicked | Occurs when an object has been clicked on with the right mouse button.
TXTextControl.TXTextControl.TextFrameActivated | Occurs when a text frame has obtained the input focus.
TXTextControl.TXTextControl.TextFrameDeactivated | Occurs when a text frame has lost the input focus.


What's New in Version 11.0

The following provides a general list of features that have been added since TX Text Control version 10.1.

New Features and Update Notes

New Properties, Methods and Events


New Features and Update Notes

TX Text Control 11.0 provides the several new features all described in the following tables.

New Features

Feature | Description
Nested Tables | A table can be inserted within another table. Such a table is called a nested table. The level of nesting is not limited. All of Text Control's text filters have been expanded to import and export nested tables. To refer to a nested table, the same properties and methods can be used as for top-level tables. The TXTextControl.TableNext property lists all top-level and all nested tables in the order they appear in the text flow. Other properties and methods have been added to get a table's nesting level or to get its outer or outermost table.
Table Splitting | A table can be split below or above the table row containing the current input position with the TXTextControl.TableSplit method. If the original table has an identifier, both parts retain their identifier. A TXTextControl.TableCreated event occurs for the bottom part to enable the application to change the identifier of the bottom part. If a table is split above the first row, a new line is inserted above the table, and if a table is split below the last row, a new line is inserted below the table. This is useful to insert text above or below a nested table that immediately starts and/or ends at the beginning or the end of the cell in which it is nested.
Multiple Undo | Text Control has a new undo buffer that supports multiple undo and redo operations. Additionally, the undo buffer now supports many more Text Control features such as images, text fields and all table operations. The new methods TXTextControl.StartUndoAction and TXTextControl.EndUndoAction can bundle more than one property call to a single undo action. The new TXTextControl.AllowUndo property activates or deactivates the undo buffer. Deactivating the undo buffer saves time and memory which can be useful, if a Text Control for example is deployed as a report generator.
Image Resolution and Compression Quality | If images are embedded in a document with their complete binary data, it can be useful to alter an image's resolution and the quality of the data compression algorithm to minimize the file size. By default, Text Control uses the image's default resolution and a default value for the data compression. The txImageCompressionQuality and txImageMaxResolution settings of the TXTextControl.LoadSaveAttribute property can be used to alter these values for all images in the complete document. The TXTextControl.ImageExportCompressionQuality and TXTextControl.ImageExportMaxResolution properties can be used to overwrite these values for a single image.
PDF Document Security | New parts of the LoadSaveAttribute property allow the setting of the standard PDF security features. Both passwords can be set: a user password to allow document opening and a master password to allow modification of the current access permissions. Furthermore, the txDocAccessPermissions part allows individual access permissions to be set.
Ruler Bar Design | The Ruler Bar Control has an additional look with a flat design. This new look is now the default setting, but the previous look can still be set with the new Appearance property.

Update Notes

Property/Method/Event | Update Note
CanRedo Property | Has been extended with additional values to indicate the action that can be redone.
CanUndo Property | Has been extended with additional values to indicate the action that can be undone.
LoadSaveAttribute Property | Has been extended with the following parts: txDocAccessPermissions, txMasterPassword, txUserPassword, txImageCompressionQuality, txImageMaxResolution.


New Properties, Methods and Events

In TX Text Control 11.0 the following new properties, methods and events have been added:

Properties

Property | Description
TXTextControl.TXTextControl.AllowUndo | Determines whether the undo buffer is active or not.
TXTextControl.TXTextControl.ImageExportCompressionQuality | Determines a value between 1 and 100, which is the quality of a lossy data compression used, if the image is saved.
TXTextControl.TXTextControl.ImageExportMaxResolution | Determines the maximum resolution in dots per inch used, if the image is saved.
TXTextControl.TXTextControl.TableCanSplit | Checks whether a table can be split.
TXTextControl.TXTextControl.TableNestedLevel | Gets the nested level for the specified table.

Methods

Method | Description
TXTextControl.TXTextControl.EndUndoAction | Defines the end of an undo action.
TXTextControl.TXTextControl.StartUndoAction | Defines the beginning of an undo action.
TXTextControl.TXTextControl.TableGetOuter | This method returns a table's outer table.
TXTextControl.TXTextControl.TableGetOuterMost | This method returns a table's outermost table.
TXTextControl.TXTextControl.TableSplit | Splits a table below or above the current input position.


Visual Basic User's Guide

Describes how to use TX Text Control with Microsoft Visual Basic.

Creating a Simple Word Processor

Working with Files

Printing

Using Marked Text Fields

A Word Processor

Connecting to Databases

Using Images

Mail Merge

Document Properties

Headers and Footers

Hypertext Links

File Drag and Drop

Using Text Frames

XML Basics

Editing in XML Mode

Using Microsoft Word Fields


Creating a Simple Word Processor

This chapter shows you how to create a small word processor from scratch with just a few lines of code. It will be able to load and save files, use the clipboard, and will have dialog boxes for character and paragraph formatting, a ruler bar, a status bar and full keyboard and mouse interface.

The source code for this example is contained in the Samples\vb6\Simple sample source directory.

Creating the Project

Creating the Controls

Connecting the Controls

Running the Program

Setting the Page View

Resizing the Text Control

Adding a Menu

What Comes Next


Creating the Project

Assuming that you have already run the Text Control installation program and started Visual Basic, the next step is to create a project for the text processor. To do this, begin by selecting the New Project command from the file menu. Then use the Project / Components... command to include the file tx4ole17.ocx into the new project. You will see four additional icons appear at the bottom of the toolbox, representing the Text Control and its Status Bar, Button Bar and Ruler Bar:

The Text Control Icon

The Status Bar Icon

The Button Bar Icon

The Ruler Icon


Creating the Controls

The next step is to put these four controls on a form and connect them. Click on the Text Control icon and draw it on the form. In the same way, create a Button Bar, two Ruler Bars and a Status Bar.

To position the tool bars, set the Align property to 1 - Align Top for the Button Bar and for the first Ruler Bar. Set it to 2 - Align Bottom for the Status Bar. For the second Ruler Bar set the Direction property to 1 - Vertical and align it to the left setting the Align property to 3 - Align Left. This will adjust everything except the width and the height of the Text Control.

Your form should now look like this:


Connecting the Controls

Add the following code to the form's Load event procedure:

[Visual Basic 6]
Private Sub Form_Load()
   TXTextControl1.ButtonBarHandle = TXButtonBar1.hWnd
   TXTextControl1.RulerHandle = TXRuler1.hWnd
   TXTextControl1.VerticalRulerHandle = TXRuler2.hWnd
   TXTextControl1.StatusBarHandle = TXStatusBar1.hWnd
End Sub


Running the Program

The text processor is not yet finished, but we can make a first attempt at running it and seeing what it can do. Click the Start button. You can type in some text, select it with the mouse, copy it to the clipboard (use the <CTRL>+<C> and <CTRL>+<V> keys as long as there is no menu), select a different font, set tabs and do lots of other things. All of these features have been built into the Text Control and can be used with almost no programming effort.

You will have noticed, however, that some features are still missing. For instance, if you resize the main window, the Text Control keeps its old size. There is no menu, and there is no horizontal scrollbar either. We will fix this in the coming chapters.


Setting the Page View

TX Text Control offers several view modes for its different tasks. To work as a word processor set the ViewMode property to Page View. This automatically adds the necessary horizontal scroll bar, page size and margins.


Resizing the Text Control

The following is involved in order to make the Text Control resize properly when the main window is resized.

Open the code window for the form that contains the Text Control. In the combo boxes on top of the code window, select Form in the Object: box and Resize in the Proc: box. The code window should show an empty procedure for the Resize event:

[Visual Basic 6]
Private Sub Form_Resize ()
End Sub

Extend it as follows:

[Visual Basic 6]
Private Sub Form_Resize ()
   TXTextControl1.Left = TXRuler2.Width
   TXTextControl1.Top = TXButtonBar1.Height + TXRuler1.Height
   TXTextControl1.Height = ScaleHeight - TXButtonBar1.Height _
      - TXRuler1.Height - TXStatusBar1.Height
   TXTextControl1.Width = ScaleWidth - TXRuler2.Width
End Sub

These lines of code will cause the Text Control's position, width and height to be adjusted every time the size of the form is altered. (The '_' character is used to extend one logical line of code to two or more physical lines).


Adding a Menu

In this chapter, you will add a menu to the text processor that enables you to call the Text Control's built-in dialog boxes.

Use the Visual Basic Menu Design Window to create a Format menu with the items Character... and Paragraph.... Name the items mnuFomat_Character and mnuFormat_Paragraph. (Please refer to the Visual Basic documentation, if you need help with creating menus).

Add the following code to the Click procedures of the menu items:

[Visual Basic 6]
Private Sub mnuFormat_Character_Click()
   TXTextControl1.FontDialog
End Sub
Private Sub mnuFormat_Paragraph_Click()
   TXTextControl1.ParagraphDialog
End Sub

Start the program again. You should be able to use the menu items to call the Font and Paragraph dialog boxes.

Now for the Edit menu. Again use the Menu Design Window and create an Edit menu that contains items for Cut, Copy, and Paste. The code for these menu items is:

[Visual Basic 6]
Private Sub mnuEdit_Cut_Click()
   TXTextControl1.Clip 1
End Sub
Private Sub mnuEdit_Copy_Click()
   TXTextControl1.Clip 2
End Sub
Private Sub mnuEdit_Paste_Click()
   TXTextControl1.Clip 3
End Sub

Having added these menu items, you can exchange formatted text with other word processors via the clipboard.

The last menu for now shall be a simple file menu. Create a File menu including the items Load... and Save As.... Place a common dialog box icon on the form and enter the following code, which will call the common dialog box to get a file name from the user, and will then load respectively save the selected file:

[Visual Basic 6]
Private Sub mnuFile_Load_Click()
   On Error Resume Next
   ' Create an "Open File" dialog box
   CommonDialog1.Filter = "TX Demo (*.tx)|*.tx"
   CommonDialog1.DialogTitle = "Open"
   CommonDialog1.Flags = cdlOFNFileMustExist Or _
      cdlOFNHideReadOnly
   CommonDialog1.CancelError = True
   CommonDialog1.ShowOpen
   If Err Then Exit Sub
   ' Pass the filename to the Text Control
   TXTextControl1.Load CommonDialog1.filename, 0
End Sub
Private Sub mnuFile_SaveAs_Click()
   On Error Resume Next
   ' Create a "Save File" dialog box
   CommonDialog1.Filter = "TX Demo (*.tx)|*.tx"
   CommonDialog1.DialogTitle = "Save As"
   CommonDialog1.Flags = cdlOFNOverwritePrompt Or _
      cdlOFNHideReadOnly
   CommonDialog1.CancelError = True
   CommonDialog1.ShowSave
   If Err Then Exit Sub
   ' Open the selected file
   TXTextControl1.Save CommonDialog1.filename, 0
End Sub


What Comes Next

It goes, of course, without saying that Text Control has many more features than those included in our little demo program. It is up to you now to include zoom, images, tables, OLE objects, paragraph frames and whatever else makes up a full-blown word processor. If you need some hints about how to integrate special features, have a look at the source code of the other sample programs or post a message in the Text Control support forum at http://www.textcontrol.com.


Working with Files

Text Control uses 8 different file formats:

  • Its own, native format, which you would normally use to store data in document files.
  • The Rich Text Format (RTF), which can be used to exchange formatted text with other applications.
  • HTML
  • XML
  • Microsoft Word format (*.docx)
  • Microsoft Word 97-2003 format (*.doc)
  • Unformatted text in ANSI or Unicode format.
  • Adobe PDF. This file format can only be used for exporting your documents.

Using RTF, HTML, Word or unformatted text is very easy: Just specify the format you want to use as a parameter of the Load or Save method.

Using RTF, HTML, Word and unformatted text, you can only read or write the contents of a single Text Control from or to a file. Using the native file format, however, you can write a file header prior to saving the Text Control data, or even write the contents of several Text Controls to one file.

The Mail Merge sample program shows you how to write the contents of Text Control and other data to a single file. The MDIDemo sample shows you how to write a file header prior to the Text Control's data and how to use RTF, HTML, Word and unformatted text.


Printing

Simple Printing

Advanced Printing

Changing Paper Bins

Print Preview


Simple Printing

Sending a file to the printer in most cases only requires a single line of code. Text Control's PrintDoc Method will automatically detect the default printer and its settings, so that you only need to specify the range of pages and number of copies you wish to have printed:

[Visual Basic 6]
TXTextControl1.PrintDoc "My Print Job", 1, _
   TXTextControl1.CurrentPages, 1

The code above will print one copy of the current document. The first parameter, "My Print Job", specifies an arbitrary name under which the print job is displayed in the print manager. The second and 3rd parameters specify the range of pages to be printed, and the last one is number of copies to be printed.

A Common Dialog box can be used to let the user select printer, range of pages, number of copies.

[Visual Basic 6]
' Display a common print dialog
CmDialog1.Copies = 1
CmDialog1.FromPage = 1
CmDialog1.ToPage = TXTextControl1.CurrentPages
CmDialog1.Min = 1
CmDialog1.Max = CmDialog1.ToPage
CmDialog1.Flags = cdlPDHidePrintToFile Or cdlPDNoSelection
CmDialog1.ShowPrinter
' Print selected pages
TXTextControl1.PrintDoc Form.Caption, CmDialog1.From, _
   CmDialog1.ToPage, CmDialog1.Copies

This code is used, for instance, in the MDIDemo sample program.


Advanced Printing

Although the options which the PrintDoc method offers are sufficient for most applications, there are situations where you may need more control over the printing process. You may, for instance, want to select a different paper bin for the first and the following pages. This is where the PrintPage method is used.

In order to give you maximum flexibility, all that PrintPage does is to send a single page to the printer. It does not even eject the printed page, so that it can be used to print the contents of multiple Text Controls on a single sheet of paper.

PrintPage only has a single parameter, which is the page number, and you need to call it for every page to be printed in turn. Some additional methods and properties are required to select a printer and to control the print job, as shown in this code snippet:

[Visual Basic 6]
For CurPage = 1 To TXTextControl1.CurrentPages
   ' Initialize the VB Printer object
   Printer.Print
   ' Select a printer
   TXTextControl1.PrintDevice = Printer.hDC
   ' Print one page
   TXTextControl1.PrintPage CurPage
   ' Eject the page
   If CurPage <> EndPage Then Printer.NewPage
Next CurPage
' Tell Print Manager we are finished
Printer.EndDoc

The following examples will show you how to extend this basic printing routine with additional features.


Changing Paper Bins

A typical requirement for office applications is to print the first page of a document with letterhead paper and the remaining pages on plain paper. This is usually done by using a printer that has two separate trays for the two types of paper. The application simply sends the first page to the first paper bin, and then switches to the second bin for the remaining pages.

The printing code from our previous example can be easily extended to achieve this:

[Visual Basic 6]
Printer.PaperBin = vbPRBNLower ' select first tray
For CurPage = 1 To TXTextControl1.CurrentPages
   Printer.Print
   ' select second tray
   if CurPage = 2 then Printer.PaperBin = vbPRBNUpper
   TXTextControl1.PrintDevice = Printer.hDC
   TXTextControl1.PrintPage CurPage
   If CurPage <> EndPage Then Printer.NewPage
Next CurPage
Printer.EndDoc


Print Preview

Text Control's PrintPage method can not only be used with printers, but also with any control that has a hDC property. For instance. a Picture Box can be used as a print preview window. This is done by simply assigning its hDC property to Text Control's PrintDevice Property. When calling PrintPage, Text Control will print to the Picture Box instead of to the printer.

This code snippet will print page 1 to a picture box named Picture1. You can use the PrintZoom Property to scale down the printout if the Picture Box is smaller than a full printer page:

[Visual Basic 6]
TXTextControl1.PrintDevice = Picture1.hDC
TXTextControl1.PrintZoom = 25 ' scale down to 25%
TXTextControl1.PrintPage 1

The MDIDemo sample program contains a sophisticated print preview form that works like this. Its source code is contained in the Samples\vb6\MDI folder.


Using Marked Text Fields

Marked Text Fields are markers which are inserted in the text. They can be used to implement a wide range of special functions in a text processor. To name just a few:

  • Mail Merge functions
  • Spreadsheet-like calculation fields
  • Bookmarks
  • Automatic table of contents and index generation
  • Hypertext viewers which include any kind of buttons, images, pop-up windows or even OLE objects in the text

Any group of characters within the text can be a marked text field. The maximum number of fields is 65,535. Text Control maintains the positions and numbers of the fields. It also takes care of loading, saving and clipboard operations.

A Simple Example

Bookmarks

Adding Strings to Marked Text Fields


A Simple Example

This first sample program will show you how fields are created and what happens when they are clicked on. The code shown here is contained in the Samples\vb6\Field1 sample source directory.

The program consists of a form with just one menu item, Insert Field!, with an exclamation mark to say that clicking on this item will cause an immediate action instead of dropping a menu. There are two Text Controls on the form, one of which is used as a normal text window (TXTextControl1), the other one as a pop-up window (TXTextControl2).

The following code is executed when the menu item is clicked on:

[Visual Basic 6]
Private Sub mnuInsertField_Click ()
   TXTextControl1.FieldInsert "--------"
End Sub

This inserts a field at the current caret position. If you move the cursor over the field, Text Control changes the mouse pointer to an upward pointing arrow to indicate that there is something to click on.

If you click on the field, the application receives a FieldClicked event, to which it responds by popping up a window which displays the field number.

Only four lines of code are required for this:

[Visual Basic 6]
Private Sub TXTextControl1_FieldClicked(ByVal FieldIndex As Integer)
   TXTextControl1.FieldCurrent = FieldIndex
   TXTextControl2.Text = "This is field no. " & FieldIndex _
      & ". Its text is: " & TXTextControl1.FieldText
   TXTextControl2.Move TXTextControl1.FieldPosX, _
      TXTextControl1.FieldPosY
   TXTextControl2.ZOrder
End Sub

The first line selects the Marked Text Field which has been clicked on. Line 2 builds the string that is to be displayed in the pop-up window. Line 3 moves the pop-up window, which is initially hidden behind the text window, to the position of the marked text field. Line 4 puts the pop-up window in front of the text window to make it visible. When the mouse button is released, the text window is moved to the front again:

[Visual Basic 6]
Private Sub TXTextControl1_MouseUp(Button As Integer, _
      Shift As Integer, X As Single, Y As Single)
   TXTextControl1.ZOrder
End Sub


Bookmarks

This example shows you how to use Text Control's marked text fields to create bookmarks. The first version will reference the bookmarks simply by their field numbers. The source code for this example is contained in the Samples\vb6\Field2 sample source directory.

The sample application has a Bookmark menu with two items which are named Insert and Go to.... Clicking Insert creates a marked text field at the current caret position. If a text selection exists, the selected text is converted into a field. If not, the character next to the caret is selected.

[Visual Basic 6]
Private Sub mnuBookmark_Insert_Click()
   If TXTextControl1.Text = "" Then
   MsgBox "Cannot insert bookmark if control is empty."
   Else
      If TXTextControl1.SelLength = 0 Then _
         TXTextControl1.SelLength = 1
      TXTextControl1.FieldInsert ""
   End If
End Sub

After typing in some text and inserting a few bookmarks, select the Go To... menu item. This will launch a dialog box which allows you to enter the number of the bookmark to jump to. There is no error processing in this example, so if you enter the number of a non-existent field, nothing will happen.

Clicking the OK button executes the following procedure:

[Visual Basic 6]
Private Sub cmdOk_Click()
   Form1.TXTextControl1.FieldCurrent = Text1.Text
   Form1.TXTextControl1.SelStart = _
      Form1.TXTextControl1.FieldStart - 1
   Form1.TXTextControl1.SelLength = _
      Form1.TXTextControl1.FieldEnd - _
      Form1.TXTextControl1.FieldStart + 1
   Unload Me
End Sub

The number which has been entered in the dialog box is taken as a value for the FieldCurrent property.


Adding Strings to Marked Text Fields

The source code for this example is contained in the Samples\vb6\Field3 sample source directory.

In commercial word processors, bookmarks are normally referenced by names, not just by numbers. The names are typed in by the user when he creates a bookmark. The Goto Bookmark dialog box then presents a listbox or combobox in which one of the strings can be selected.

The Insert Bookmark... menu item in this version of the program creates a dialog box where the user can enter a label for the bookmark.

When the OK button is clicked, the following code is executed:

[Visual Basic 6]
Private Sub btnOK_Click()
   Form1.TXTextControl1.FieldInsert ""
   Form1.TXTextControl1.FieldData( _
      Form1.TXTextControl1.FieldCurrent) = Text1
   Form1.TXTextControl1.SelLength = 0
   Unload Me
End Sub

First, a marked text field is created at the current caret position. Second, the name of the bookmark, which is the text that has been typed in by the user, is stored in the FieldData property.

The Goto Bookmark dialog box contains a combo box which lists all of the bookmarks which have been created so far.

The combo box is filled with the bookmark titles when its form is loaded:

[Visual Basic 6]
Private Sub Form_Load()
   Dim nFieldID As Integer
   nFieldID = 0
   ' Fill the combobox with bookmarks
   Do
      nFieldID = Form1.TXTextControl1.FieldNext(nFieldID, 0)
      If nFieldID > 0 Then
         cboBookmark.AddItem _
            Form1.TXTextControl1.FieldData(nFieldID)
      End If
   Loop While nFieldID <> 0
   ' Copy the first item to the edit control part of
   ' the combo box
   cboBookmark.Text = cboBookmark.List(0)
End Sub

When the OK button is clicked, the bookmark list is searched for the string which has been selected in the combo box, and the corresponding marked text field is selected.

[Visual Basic 6]
Private Sub cmdOk_Click()
   Dim nFieldID As Integer
   nFieldID = 0
   ' Search for the requested bookmark
   Do
      nFieldID = Form1.TXTextControl1.FieldNext(nFieldID, 0)
      If nFieldID > 0 Then
         If Form1.TXTextControl1.FieldData(nFieldID) = _
            cboBookmark.Text Then
            Exit Do
         End If
      End If
   Loop While nFieldID <> 0
   ' If the bookmark has been found, select it.
   ' Text Control will then automatically scroll to
   ' make it visible.
   If nFieldID <> 0 Then
      Form1.TXTextControl1.FieldCurrent = nFieldID
      Form1.TXTextControl1.SelStart = _
         Form1.TXTextControl1.FieldStart - 1
      Form1.TXTextControl1.SelLength = _
         Form1.TXTextControl1.FieldEnd - _
         Form1.TXTextControl1.FieldStart + 1
   Else
      MsgBox "Bookmark not found."
   End If
   Unload Me
End Sub

You can also extend the sample program with a dialog box, similar to the Go To Bookmark... dialog, in which a bookmark can be deleted without deleting the text. This would require converting the Marked Text Field to normal text. Use the FieldDelete method to achieve this.

More information about marked text fields and a list of all properties, methods and events that can be used with marked text fields, can be found in the chapter Technical Articles - Marked Text Fields.


A Word Processor

This chapter shows you how to use Text Control to write a standard word processor. The program is based upon the MDI sample from the Visual Basic Programmer's Guide, with the TextBox controls replaced by Text Controls. If you are not familiar with MDI, control arrays or creating a toolbar you may want to read that chapter first.

The source code for this example is contained in the Samples\vb6\MDI sample source directory.

Adding a PageSetup Dialog Box

A Print Dialog Box

Search and Replace

Using Paragraph Frames

Dialog Boxes for Text and Background Color


Adding a PageSetup Dialog Box

The Page Setup dialog box is used to determine the page size and print margins. The maximum page size is restricted by the capabilities of the default printer. For implementation details, look at the source code of the PageDlgform.


A Print Dialog Box

When the Print... menu item is clicked, first a Common Dialog box is shown to let the user enter the range of pages, number of copies and printer specific information. The rest of the procedure, which is part of the MDIChild form, is just a loop which sets the appropriate Text Control properties for every page to be printed.


Search and Replace

Searching and replacing is entirely done in Text Control. You just have to assign a value of 1 for Search or 2 for Search And Replace to the FindReplace method. Text Control then opens the Windows Common Dialog box.


Using Paragraph Frames

With Text Control, you can add lines and frames to a paragraph or a range of paragraphs. For instance, you can put a line on top of a caption like in the property reference of the printed manual.

The dialog box for paragraph frames is not included in the Text Control, but the source code is included in the MDI sample.

The properties which are responsible for paragraph frames are FrameDistance, FrameLineWidth, and FrameStyle.


Dialog Boxes for Text and Background Color

This is also done with Common Dialogs. The color value returned from the dialog box is assigned to the ForeColor or BackColor properties.


Connecting to Databases

TX Text Control can be connected to any type of database, and store formatted text in any of its text formats. You can save a complete document as a record, or load text from a database into table cells and Marked Text Fields. Typical applications which can be created are mail merge, report generators, formatted data entry masks, and all types of business applications where documents are created from information stored in a database.

This chapter shows you how to save the contents of a Text Control to a database. The data is stored as an RTF formatted string in a text field.

The source code for this sample program is contained in the Samples\vb6\DataAccess sample source directory.

The Sample Program

Saving a Record

Retrieving a Record


The Sample Program

The sample program consists of a form with 2 Text Controls, both of which display the same record of a database. The upper control displays it as formatted text, whereas, for demonstration purposes, the lower control shows the record's RTF source code.

Clicking the Next button will save any changes you have made in the upper window, and advance to the next record.


Saving a Record

All data access is handled by two Methods, which are SaveToMemory and LoadFromMemory. The SaveToMemory Method stores formatted text to a byte array, which is then passed on to the database engine using Visual Basic's DAO or ADO functions. The following code uses DAO syntax.

[Visual Basic 6]
Private Sub PutRecord()
   Dim ba() As Byte, s As String
   ba = TXTextControl1.SaveToMemory(5, 0)
   ' convert from ANSI to Unicode
   s = StrConv(ba, vbUnicode)
   rs.Edit
   rs("RTF") = s
   rs.Update
End Sub

Other text formats can be used by simply changing the first parameter of the SaveToMemory method.


Retrieving a Record

To retrieve a record from the database and display it, the data is converted from Unicode to ANSI, and then passed on to the LoadFromMemory method of Text Control 1. As Text Control 2 just displays the RTF source code without any formatting, we can simply use the Text property to load it.

[Visual Basic 6]
Private Sub GetRecord()
   Dim ba() As Byte, s As String
   ' Load RTF data and convert it to a byte array
   s = rs("RTF")
   ba = StrConv(s, vbFromUnicode)
   ' Display RTF data in Text Control 1
   TXTextControl1.LoadFromMemory ba, 5, 0
   TXTextControl1.Refresh
   ' Display RTF source code in Text Control 2
   TXTextControl2.Text = s
End Sub

The text format used in this example is RTF, which has the advantage of being accessible by most word processing programs. If this is not an issue, Text Control's binary format may be a better choice, as it is more compact and will take up less space in a database.


Using Images

TX Text Control provides three different methods for inserting images:

  • The ImageInsert method is the default method for inserting images. An image inserted with this method is anchored to a paragraph. Text can flow around the image, and the image moves with the paragraph.
  • Images inserted with the ImageInsertAsChar method are handled like a single character in the text. This method is often used for inserting small images and icons.
  • The ImageInsertFixed method inserts an image at a fixed position on the page. The image will keep its position regardless of the surrounding text.

Images can be inserted from a file or from the clipboard. When saving a document, you can select whether to embed image data in the document file, or save a reference to a seperate image file. Note that not all options are available in all file formats. For instance, while image data can be embedded in .RTF, .DOCX and .DOC files, HTML does not provide this option.

Further options are:

  • to convert images to a different file format,
  • to convert embedded images to image files, and
  • to change image resolution and compression rate.

This is especially useful, if you create HTML files, where embedded images and image file formats like WMF or TIFF need to be converted to JPEG or GIF files for display in a browser. Image resolution and compression settings are also required for creating PDF files, for instance to create one version of a PDF with low-resolution images for viewing on screen, and another one with high resolution images for printing.

An overview of all properties, methods and events which can be used in conjunction with images can be found at Images, Text Frames and OLE Objects. Properties which have a name that begins with "Object" can be used with images as well as other kinds of embedded objects, like text frames and OLE objects, whereas those starting with "Image" only apply to images.

Inserting an Image

Setting Image Attributes


Inserting an Image

The source code for this sample program is contained in the Samples\vb6\Images sample source directory.

The mnuImage_Insert_Click function shows you how to open a dialog box for selecting an image file, and then insert the image:

[Visual Basic 6]
Private Sub mnuImage_Insert_Click()
    On Error GoTo err_InsertImage

    CmDialog1.DialogTitle = "Insert Image"
    CmDialog1.Filter = TXTextControl1.ImageFilters
    CmDialog1.FileName = ""
    CmDialog1.Flags = cdlOFNPathMustExist Or cdlOFNOverwritePrompt Or cdlOFNHideReadOnly
    CmDialog1.CancelError = True
    CmDialog1.ShowOpen

    TXTextControl1.ImageInsert CmDialog1.FileName, -1, 1, 0, 0, 100, 100, 3, 100, 100, 100, 100
    Exit Sub

err_InsertImage:
    If Err <> cdlCancel Then MsgBox Err.Description

End Sub

The image is inserted using the ImageInsert method.


Setting Image Attributes

TX Text Control has a built-in dialog box which enables you to change the size of an image, the way images are stored, and various other settings. In the sample program, the Image Attributes dialog box is invoked either with the Image Settings menu item, or by right-clicking on an image. The dialog box is opened using the ObjectAttrDialog method:

[Visual Basic 6]
Private Sub mnuImage_Settings_Click()
    TXTextControl1.ObjectAttrDialog
End Sub

Private Sub TXTextControl1_ObjectRightClicked(ByVal ObjectId As Integer)
    TXTextControl1.ObjectAttrDialog
End Sub


Mail Merge

The chapter Connecting to Databases showed you how to store the entire contents of a Text Control in a database field. For implementing mail-merge functionality, however, the requirements are different: the contents of database fields have to be inserted at specified positions in a previously prepared document. The following sample program provides you with the knowledge of how to do this.

Step 1 - Merging Database Data and Text

Step 2 - Printing more than one Record

Step 3 - Dynamic Template Generation


Step 1 - Merging Database Data and Text

The program consists of two forms, Form1, for creating a text template and Form2 for connecting it to the database.

Start the program and use the Template/ Load... command to load the sample template file e.g. template1.tx. The file contains various fields which are to be replaced by database entries. Select Database / Browse Database to access Form2. Now you are able to skip through the database entries connected with the template. When you click the Merge button in Form2, the contents of the three database fields are copied to the text fields in Form1. You can select a different record by clicking one of the data control buttons in Form2, and then clicking Merge again to replace the fields.

This example has a couple of interesting features. We will focus on the features in which Text Control's functionality is primaraily used. You will find a menu item, with which a template file can be loaded. This file already contains several Marked Text Fields. So we can get some data from a database into these fields, each one has a unique name. These unique names are saved in the FieldData property.

Using a second menu item, a further form can be opened - this allows a suitably prepared database to be linked. With a button click, the current data set can be merged into the document.

The most important function of this example is the one that allows a data field from the linked database to be merged into a field from Text Control. To get this to work, we need to get the field number of the Marked Text Field that belongs to the data field. This can be achieved using the following code:

[Visual Basic 6]
Function FindField(name As String) As Integer
   Dim id As Integer
   Dim foundID As Integer
   foundID = 0
   id = Form1.TXTextControl1.FieldNext(0, 0)
   While id <> 0
      If Form1.TXTextControl1.FieldData(id) = name Then
         foundID = id
      End If
      id = Form1.TXTextControl1.FieldNext(id, 0)
   Wend
   If foundID <> 0 Then
      FindField = foundID
   Else
      FindField = 0
   End If
End Function

Using a loop we go through all the fields from the Text Control - and the FieldData property belonging to each field - to check whether it is the same as the name we are searching for. If we get a hit, its' ID is returned. If no field is found, then a zero is returned.

For the merging of the field data with the database we will have to add another function to our application. Let's have a look at the source code:

[Visual Basic 6]
Sub Merge(TXDest As TXTextControl, field As String)
   Dim id As Integer
   Dim i As Integer
   Dim db As Database
   Dim rs As Recordset
   Dim data, SQL As String
   ' Open database
   Set db = Form2.Data1.Database
   Set rs = db.OpenRecordset(db.TableDefs(0).name)
   ' Find record
   SQL = "SELECT * FROM " + db.TableDefs(0).name + _
        " where " + rs.Fields(1).name + " like '" +_
        field + "'"
   Set rs = db.OpenRecordset(SQL)
   rs.MoveFirst
   ' Now fill all fields with data
   For i = 0 To rs.Fields.Count - 1
      ' Get ID of field with the according name
      id = FindField(rs.Fields(i).name)
      ' Get data from database
      data = rs(rs.Fields(i).name)
      If id <> 0 Then
         TXDest.FieldCurrent = id
         TXDest.FieldText = data
      End If
   Next i
End Sub

This function opens the database, and fills up each Marked Text Field of the template with the data from each database field. You will find the whole sample project in the Samples\vb6\Mailmerge\Step1 sample directory.


Step 2 - Printing more than one Record

Now we are going to set up a print queue. The user will have the option to add single records to the print queue and then start printing the queue on command. As shown in step 1, the user can browse through a database and merge single data records into the document.

The queue is a simple list box, in which the company name of the current record is added. This record name will be replaced by the actual data from the current record.

To print a document in the background, we have to use the following code (in the Form2 of the sample project). We use a second, invisible Text Control, which is filled with the data from the template and merge the data into this control.

We do not have to write a second routine for the merging, the old one has been changed a little and defined globally. This globally defined routine now gets the parameters from the Text Control in which the merging is currently taking place. What's more, the actual records from the database are now merged in the marked text fields and no longer in the label captions.

Now we just need to call StartPrinting to start the printing. Let us take a look at the following VB code:

[Visual Basic 6]
Sub StartPrinting()
   Dim data() As Byte
   Dim i As Integer
   ' Copy document to hidden TX
   data = Form1.TXTextControl1.SaveToMemory(3, False)
   Form2.TXHidden.LoadFromMemory data, 3, False
   ' Print queue
   While (doPrint And Form2.List1.ListCount > 0)
      Merge Form2.TXHidden, Form2.List1.List(0) ' Merge data
      For i = 1 To Form2.TXHidden.CurrentPages
         Printer.Print
         Form2.TXHidden.PrintDevice = Printer.hDC
         Form2.TXHidden.PrintPage i
         Printer.NewPage
      Next i
      Printer.EndDoc
      ' First item printed, remove it from queue
      RemoveItem (0)
   Wend
End Sub

The complete content of the visible document is copied into the second, hidden Text Control. We use the LoadFromMemory and SaveToMemory methods to do this. Now we simply have to work off the queue. A simple while loop, which runs until there are no longer entries in the list box, takes care of this.

However first, we have to do the actual merging. The hidden Text Control and the string at position 0 of the list box are passed as parameters. In this case, it is the company name of the record which is to be printed. The document is then printed and finally the record is removed from the list box.

The source code for this sample can be found in the Samples\vb6\MailMerge\Step2 directory.


Step 3 - Dynamic Template Generation

This step will show you how to build a real mail-merge layout editor. In other words, the user should be able to select a database and insert its fields into his active document just by clicking the mouse. Then, when we start the actual mail merging process, these fields will be replaced by the data from the database.

However, the problem is that we do not know how many fields there are in the database. In other words our application must be able to work with databases of varying size.

Secondly, we are going to set up a menu item, which will call a Common Dialog so that the user can select a database. However, the database is not really loaded - just the name of the database is stored in the curDBName variable. Storing an entire database in the memory could be somewhat problematic, should the database be several terabytes in size.

Thirdly, we need to let the user insert fields from the database into this document. However, only fields which are in the database may be inserted into the active document. To do this, we use a combo box. On loading the database we then proceed to fill this combo box with the names of its fields. Using a simple button, we can then insert a field from the database into our active document.

Each piece of static code dealing with database fields has to be replaced with dynamic field names.

Consider the Browse Database form: In the previous example, the labels which display the data from the database were statically linked to the database.

Using a control array, these labels now need to be dynamically created when the form is loaded. Once they have been loaded, they then have to be linked to the corresponding database field.

To do this, we need to use the following Visual Basic code:

[Visual Basic 6]
Private Sub Form_Load()
   Data1.DatabaseName = curDBName
   doPrint = False
   TXHidden.Left = 10000 ' Move TX out of the visible area
   Dim db As Database
   Dim rs As Recordset
   ' Find record
   Set db = OpenDatabase(curDBName)
   Set rs = db.OpenRecordset(db.TableDefs(0).name)
   lblField(0).Caption = rs.Fields(0).name
   lblData(0).DataField = rs.Fields(0).name
   ' Create labels
   For i = 1 To rs.Fields.Count - 1
      Load lblField(i)
      lblField(i).Top = 320 + (i * 300)
      lblField(i).Caption = rs.Fields(i).name
      lblField(i).Visible = True
      Load lblData(i)
      lblData(i).Top = 320 + (i * 300)
      lblData(i).DataField = rs.Fields(i).name
      lblData(i).Visible = True
      ' if i > 6 We need more space
      If i > 6 Then
         Form2.Height = Form2.Height + 300
         Frame1.Height = Frame1.Height + 300
         Data1.Top = Data1.Top + 300
         cmdMerge.Top = cmdMerge.Top + 300
         cmdCancel.Top = cmdCancel.Top + 300
      End If
   Next i
End Sub

On one side, we have the field labels, which will show the name of the currently active database field and on the other we have data labels, which will display content from the database.

As soon as we have more that seven fields in the database, the form will have to be enlarged so that there is enough room to accommodate all the labels.

A very important point here is the saving and loading of the templates: When the fields from a database appear in the active document, the connected database must also be loaded when the document is loaded.

Therefore, we need to save the name of the database in the document. To do this, we have to write a header to the document we are saving. Only then may we save the Text Control data. On loading, the header is read first.

Here is the Visual Basic code to do exactly this:

[Visual Basic 6]
Private Sub mnuSaveTemplate_Click()
   Dim FileID As Long
   Dim lFilePos As Long
   On Error Resume Next
   ' Create a "Save File" dialog box
   CommonDialog1.Filter = "TX Demo (*.ttx)|*.ttx"
   CommonDialog1.DialogTitle = "Save As"
   CommonDialog1.Flags = cdlOFNOverwritePrompt Or cdlOFNHideReadOnly
   CommonDialog1.CancelError = True
   CommonDialog1.ShowSave
   If Err Then Exit Sub
   ' Write Header
   Open CommonDialog1.FileName For Binary As #1
   FileID = FILE_ID
   Put #1, , FileID
   Put #1, , curDBName
   Put #1, , vbCrLf
   lFilePos = loc(1)
   Close #1
   TXTextControl1.Save CommonDialog1.FileName, lFilePos, 3
End Sub

The project files for this sample can be found in the Samples\vb6\MailMerge\Step3 directory.


Document Properties

This example shows how to use the TXTextControl.LoadSaveAttribute property to set and get document properties for rich text formats such as RTF, DOC and DOCX in a Text Control application.

Document properties describe or identify a document through meta-data, like title, subject or author name.

The code shown here is contained in the Samples\VB6\DocProperties sample source directory.

The Sample Program

The LoadSaveAttribute property can be used to set and get various attributes when loading and saving a document.

In this sample project, the use of the following document properties is shown:

  • txDocTitle
  • txDocSubject
  • txAuthor
  • txDocKeywords
  • txCreationDate
  • txLastModificationDate

When the program is started, default values are set for each attribute, including the creation and modification dates, and shown in the text boxes. The user is now able to edit each value except the creation and modification dates, which are set automatically. After the Save button has been clicked, the document properties are retrieved from the text boxes and assigned to each attribute. The creation and modification dates are set automatically to the current system date and time, however the creation date is only set, if it has not been retrieved previously so it will not be overwritten with the current date and time every time the document is saved.

[Visual Basic 6]
Private Sub SaveButton_Click()

   ' Retrieve each attribute from the corresponding text box
   With TXTextControl1
      .LoadSaveAttribute(txDocTitle) = Text_Title.Text
      .LoadSaveAttribute(txDocSubject) = Text_Subject.Text
      .LoadSaveAttribute(txAuthor) = Text_Author.Text
      .LoadSaveAttribute(txLastModificationDate) = DateTime.Now
      .LoadSaveAttribute(txDocKeywords) = SetKeyWords(Text_Keywords.Text)
      ' Check if a creation date had already been through a load operation.
      ' If a creation date has not been set, use the current date and time.
      If (Text_CreationDate.Text = "") Then .LoadSaveAttribute(txCreationDate) = DateTime.Now
      .Save App.Path + "\Document_Properties.rtf", 0, 5, False
   End With

   ' Show message box to the user to make sure the Load button is clicked next.
   MsgBox "Document properties have been saved!" + vbCr + "Please click on the Load button.", vbOKOnly, "Document properties saved"

   ' Clear the text boxes once the document has been saved.
   Text_Title.Text = ""
   Text_Subject.Text = ""
   Text_Author.Text = ""
   Text_Keywords.Text = ""
   Text_ModDate.Text = ""
   Text_CreationDate.Text = ""
   ' Reset and clear the TXTextControl
   TXTextControl1.ResetContents

End Sub

When loading a document, the document's attributes are retrieved from the LoadSaveAttribute property and assigned to the text boxes.

[Visual Basic 6]
Private Sub LoadButton_Click()

   ' Retrieve each attribute from the loaded document
   With TXTextControl1
      .Load App.Path + "\Document_Properties.rtf", 0, 5, False
      Text_Title.Text = .LoadSaveAttribute(txDocTitle)
      Text_Subject.Text = .LoadSaveAttribute(txDocSubject)
      Text_Author.Text = .LoadSaveAttribute(txAuthor)
      Text_Keywords.Text = GetKeyWords(.LoadSaveAttribute(txDocKeywords))
      Text_ModDate.Text = .LoadSaveAttribute(txLastModificationDate)
      Text_CreationDate.Text = .LoadSaveAttribute(txCreationDate)
   End With

End Sub

There are 2 helper functions used in this sample to convert between TAB and comma separated strings, GetKeyWords and SetKeyWords. Both functions expect a string and return the modified string.

GetKeyWords replaces all TAB characters in a given string with commas, SetKeyWords replaces all commas with TAB characters.


Headers and Footers

This example shows how to use headers and footers. The source code is contained in the Samples\vb6\Headers sample source directory.

TX supports headers as well as footers. You also have the ability to create a different header or footer for the first page.

The Sample Program

To insert a header or footer in the example, click on Insert and choose one of the four possible options. The code that is executed when clicking on one of the menu items is almost the same. For the Header menu item it looks as shown below. The line

[Visual Basic 6]
TXTextControl1.HeaderFooter = TXTextControl1.HeaderFooter + txHeader

informs Text Control that a header should be added to the current settings.

Setting the HeaderFooterStyle property to txMouseClick enables the user to activate the header with a single click rather than a double-click. Activating a header or footer with a double-click is Text Control's default setting. More information about how to use headers and footers and a list of all properties, methods and events that can be used with headers and footers, can be found in the in the chapter Technical Articles - Headers and Footers.

When using properties, Text Control distinguishes between the main text and headers or footers. To switch between these different independent text parts, Text Control provides the HeaderFooterSelect method:

[Visual Basic 6]
TXTextControl1.HeaderFooterSelect txHeader
TXTextControl1.SelText = "Header"
TXTextControl1.HeaderFooterSelect 0

This code selects the header, so that the following code affects the header and then sets the headers text. Finally the mode is reset to zero using the HeaderFooterSelect method. More information about programming with headers and footers see the chapter Technical Articles - Headers and Footers - Programming Headers and Footers.

A header or footer is activated from programming code using the HeaderFooterActivate method. To delete a header or footer, simply subtract the txHeader constant from the current HeaderFooter settings.The following is the complete code of the menu item:

[Visual Basic 6]
Private Sub mnuHeader_Click()
   If mnuHeader.Checked = False Then
      TXTextControl1.HeaderFooter = _
         TXTextControl1.HeaderFooter + txHeader
      TXTextControl1.HeaderFooterSelect txHeader
      TXTextControl1.SelText = "Header"
      TXTextControl1.HeaderFooterSelect 0
      TXTextControl1.HeaderFooterActivate txHeader
      mnuHeader.Checked = True
   Else
      TXTextControl1.HeaderFooter = _
         TXTextControl1.HeaderFooter - txHeader
      mnuHeader.Checked = False
   End If
End Sub


Hypertext Links

This chapter shows how to use Text Control's marked text fields to insert hypertext links and targets into text documents and how to respond to events which Text Control fires when the user clicks on a hypertext link.

The source code for the following examples is contained in the sub folders Step1 to Step4 of the Samples\vb6\Hyperlnk sample source directory.

Step 1 - Inserting a Hypertext Link

Step 2 - Adding a Dialog Box for Inserting Hypertext Links

Step 3 - Adding Targets

Step 4 - Adding Jumps to External Targets


Step 1 - Inserting a Hypertext Link

In this first sample program a hypertext link will be inserted in a text document. The document is saved then as a HTML file so that it can be viewed in a browser.

Hypertext links are handled as a special type of a marked text field. A hypertext link therefore is inserted by calling the FieldInsert method, and then specifying the type of the field with the FieldType property:

[Visual Basic 6]
TXTextControl1.FieldInsert "Text Control Web Site"
TXTextControl1.FieldType(TXTextControl1.FieldCurrent) = _
         txFieldExternalLink

To store the target to where the link points, the FieldTypeData property is used:

[Visual Basic 6]
TXTextControl1.FieldTypeData(TXTextControl1.FieldCurrent)=_
         "http://www.textcontrol.com"

The following line of code saves the document, containing the hypertext link, which has just been inserted as a HTML file in the sample folder:

[Visual Basic 6]
TXTextControl1.Save App.Path & "\step1.html", ,4 , 0

When this file is loaded with a web browser, the hypertext link will be displayed as specified in your browser's settings. Clicking on the link, will take you to the Text Control web site.

Note that there is no code for the Click events yet, so clicking on the hypertext link in the Text Control will have no effect. Also, the link is neither underlined nor colored.


Step 2 - Adding a Dialog Box for Inserting Hypertext Links

In this second sample program a dialog box is created which enables the user to insert hypertext links in a more convenient way. Additionally, hypertext links which have previously been inserted or loaded from a file, can be edited and modified. Note that, while hypertext links are usually associated with HTML files, they can as well be stored in RTF or Microsoft Word files, or in Text Control's proprietary format.

The dialog box has two text boxes. The first is for the text that represents the hypertext link in the document and the second is for the address, to where the link points. In the step 1 example, the representing text was "Text Control Web Site", and the address, to where the link points, was "http://www.textcontrol.com".

The same dialog box is used for both, inserting a new and editing an existing hypertext link. Depending on whether the current input position is inside of an existing link, this link is modified. Otherwise a new one is inserted.

The dialog form's properties, i tx and bShowHyperlinks, are used to pass a Text Control's reference and some information about how to display the hypertext links to the form.

[Visual Basic 6]
Public Sub do_mnuInsert_Hyperlink_Click(tx As _
            TXTextControl, bShowHyperlinks As Boolean)
   Set frmHyperlink.tx = tx
   frmHyperlink.bShowHyperlinks = _
      (mnuView_Hyperlinks.Checked = True)
   frmHyperlink.Show 1
End Sub

When the form is loaded, the text boxes are filled with the text and link information when the current input position is inside of an existing link:

[Visual Basic 6]
Private Sub Form_Load()
   If CaretInsideHyperlink(tx) <> 0 Then
      txtLinkedText = tx.FieldText
      txtLinkTarget = tx.FieldTypeData(tx.FieldCurrent)
   Else
      txtLinkedText = tx.SelText
   End If
End Sub

The user then can change the displayed information. The information is then transfered to the document by either inserting a link or modifying the existing one when the OK button is pressed:

[Visual Basic 6]
If tx.FieldAtInputPos <> 0 Then
   ' editing an existing hypertext link
   tx.FieldText = txtLinkedText
   tx.FieldType(tx.FieldCurrent) = txFieldExternalLink
   tx.FieldTypeData(tx.FieldCurrent) = txtLinkTarget
Else
   ' insert new hypertext link
   tx.FieldInsert txtLinkedText
   tx.FieldType(tx.FieldCurrent) = txFieldExternalLink
   tx.FieldTypeData(tx.FieldCurrent) = txtLinkTarget
   HighlightHyperlinks tx, bShowHyperlinks
End If

Finally, there is a menu item to switch the character format of the hyperlink's text to blue colored and underlined style. The menu item calls the function HighlightHyperlinks, which is defined in the file HyperlinkFunctions.bas.


Step 3 - Adding Targets

Step 1 and 2 only handle references to external resources, i.e. addresses of web pages or files. In this step, links to positions in the same document will be handled. These links are called internal links and the positions, to where they point, are called targets. Targets are also referred to as anchors (in the context of HTML editors) or bookmarks (in word processors). When using this example, first add some text and then some targets with the Insert / Target... menu item. Finally use the Insert / Hypertext Link... menu item to add links to these targets.

1. Inserting a Target:

Targets are realized again as a special type of a marked text field. The type and the target's name must be set with the FieldType and the FieldTypeData properties.

Unlike links, targets have no visible text, therefore an empty field must be inserted with the FieldInsert method to insert a target:

[Visual Basic 6]
Dim TargetName As String
TargetName = InputBox("Target name:", "Insert target")
If TargetName <> "" Then
   TXTextControl1.FieldInsert ""
   TXTextControl1.FieldType(TXTextControl1.FieldCurrent) = _
      txFieldLinkTarget
   TXTextControl1.FieldTypeData( _
      TXTextControl1.FieldCurrent) = TargetName
End If

Only one text box is required to display the name of a target, so a simple InputBox statement can be used.

Inserting Links to Targets

To insert links to the just inserted targets, the Hypertext Link dialog box is extended with a list box showing the names of all targets the document contains. The FieldNext method is used to fill this list box:

[Visual Basic 6]
Dim FieldID As Integer
List1.Clear
FieldID = tx.FieldNext(0, &H100&)
While FieldID <> 0
   List1.AddItem tx.FieldTypeData(FieldID)
   FieldID = tx.FieldNext(FieldID, &H100&)
Wend

When the user selects a target, the Link To field is filled with the target's name.

After typing the link's text and pressing the OK button, the link is inserted. An internal link is inserted in the same way as the external links from step 1, but the FieldType property now is set to txFieldInternalLink and the FieldTypeData property is set to the target's name.

2. Jumping to a Target:

After inserting internal links and targets, a jump must be realized. When the user clicks on a marked text field that represents a hypertext link, Text Control fires a FieldLinkClicked event. The information provided through this event can be used with the FieldGoto method to jump to the target:

[Visual Basic 6]
Private Sub TXTextControl1_FieldLinkClicked( _
      ByVal FieldIdAs Integer, _
      ByVal FieldType As Integer, _
      TypeData As String)
   TXTextControl1.FieldGoto txFieldLinkTarget, TypeData
End Sub

While the FieldGoto method is used for targets within the same file, links to external targets must be treated differently. When the Jumping to an External Target event occurs, and the FieldType parameter indicates that the link is external, then it depends on the type of the application, what to do. External links can point to, for instance, files on the local harddisk, or addresses in the internet.

Note that responding to the events is only required for making the hypertext links work while the text is edited in Text Control. If the text is saved to a file and displayed with a browser, then the hypertext links will work depending on the used browser.


Step 4 - Adding Jumps to External Targets

Finally, in this step, jumps to other documents and jumps to targets in these documents are added.

1. An Enhanced Dialog Box for Displaying and Selecting Targets:

Again the Hypertext Link dialog box is extended to choose an external file. A Choose File... button is placed on the form that triggers a common dialog.

After the user has chosen a file, its name is displayed in the text box and the file is searched for internal targets:

[Visual Basic 6]
Private Sub CheckFileForTargets(file As String)
   tx(1).LoadSaveAttribute(txEnableLinks) = True
   tx(1).Load file, 0, 4
   FillListboxWithTargets (1)
   optSelFile.Value = True
   loadedFile = file
End Sub

For this purpose the file is loaded in a second, invisible Text Control. Then the FieldNext method is used as in step 3 to list all targets.

2. Jumping to an External Target:

To implement the jump to an external link, the code added to the FieldLinkClicked event in step 3 must be extended. The following code does not handle jumps to internet addresses, it only implements jumps to targets in other files. To separate a file from a name of a target, Text Control uses the '#' character. The following code separates the file name and the target's name, loads the file with the Load method and jumps to the target with the FieldGoto method:

[Visual Basic 6]
ElseIf FieldType = txFieldExternalLink Then
   'This sample does not feature links to www sites,
   'so exit sub
   If Left(TypeData, 7) = "http://" Then
      Exit Sub
   End If
   TXTextControl1.LoadSaveAttribute(txEnableLinks) = True
   pos = InStr(TypeData, "#")
   'File name includes an internal link
   If pos >= 0 Then
      'Ask the user to save changes, if any
      If bDocDirty Then
      ret = MsgBox("Save changes?", vbYesNoCancel, _
               "Question")
         If ret = vbYes Then
            mnuFile_SaveAs_Click
         ElseIf ret = vbCancel Then
            Exit Sub
         End If
   End If
      'Extract file name & path from full path
   str = Left(TypeData, pos - 1)
      TXTextControl1.Load str, 0, 4
      'Extract file position from full path
      str = Mid(TypeData, pos + 1)
      TXTextControl1.FieldGoto txFieldLinkTarget, str
   Else
      'File name doesn't include an internal link
      TXTextControl1.Load TypeData, 0, 4
   End If
End If

3. Loading and Saving Files containing Hypertext Links:

When an HTML, RTF or Microsoft Word document is loaded, Text Control must convert containing hypertext links to appropriate marked text fields as described above. To perform this, a programmer must set the LoadSaveAttribute (txEnableLinks) before using the Load method. Otherwise hypertext links and target fields are not converted. When a document is saved, marked text fields that represent hypertext links, are always converted to the appropriate format.

If Text Control's proprietary format is used, setting LoadSaveAttribute is not necessary.

More information about hypertext links and a list of all properties, methods and events that can be used with marked text fields, can be found in the chapter Technical Articles - Marked Text Fields - Special Types of Marked Text Fields.


File Drag and Drop

File Drag and Drop is an often-used feature in windows environments. Dragging a file from the Explorer window and dropping it onto a window is the easiest way to load a document in any text editor or to insert images into a document. To implement the functionality for TX Text Control, a Windows message must be intercepted that the Explorer sends to the TX Text Control window when a file is dropped on a window. This process is called sub-classing and the following sample project shows you how to do it.

The Sample Program

The actual drop handling happens in the following handler:

[Visual Basic 6]
Private Sub OnDropFiles(Files() As String, Count As Integer, X As Long, Y As Long)

    Dim iFileType As Integer, i As Integer
    Form1.TXTextControl1.SelStart = Form1.TXTextControl1.InputPosFromPoint(X,Y)
    ' If only one file is dropped, the user can choose how to insert the file
    If Count = 1 Then
        iFileType = GetFileType(Files(0))
        If (iFileType = IMAGE_FILE) Then
            Form1.TXTextControl1.ObjectInsertAsChar 0, Files(0), -1, 100,
            100, 0, 1, 0
        ElseIf (iFileType <> 0) Then
            ' Create a PopUp Menu
            Form1.PopupMenu Form1.mnuPopup, 0, X, Y
            ' Either append documents or load the document...
            If (g_CurMenu = 1) Then
                Form1.TXTextControl1.Load Files(0), 0, iFileType, False
            ElseIf (g_CurMenu = 2) Then
                Form1.TXTextControl1.Load Files(0), 0, iFileType, True
            End If
        End If
    Else
        For i = 0 To Count - 1
            iFileType = GetFileType(Files(i))
            If (iFileType = IMAGE_FILE) Then
                Form1.TXTextControl1.ObjectInsertAsChar 0, Files(i), -1, 100,
                100, 0, 1, 0
            ElseIf (iFileType <> 0) Then
                Form1.TXTextControl1.Load Files(i), 0, iFileType, True
            End If
        Next i
    End If
    g_CurMenu = 0
End Sub

The OnDropFiles handler is called when a WM_DROPFILES message is trapped and it capsulates the system calls.

The first parameter of the OnDropFiles procedure is an array of strings. It holds the file names of all the files which have been dropped onto the TX Text Control window. The Count parameter tells how many files were dropped and the X and Y parameters hold the coordinates of the drop event.

The first thing that happens in the handler is that the current input position of the TX Text Control window is set to the location were the drop event occured. This can be done using the InputPosFromPoint method. It is then checked how many files are being dropped. If only one file is dropped we can offer the user the choice to insert the file being dropped into the existing text at the current input position or to load the file and replace the current contents of the document. A popup menu is shown to let the user decide.

But before that we must determine the type of the file being dropped. This is done by the GetFileType function. It returns 0, if the file type is not known or the TX Text Control internal values for different file types. These are for example 1 for text, 5 for RTF, 13 for DOCX as shown in the Save method. If an image is dropped, the function returns 10 and instead of TX Text Control's Load function the ObjectInsertAsChar method is called to insert the image.


Using Text Frames

This chapter describes how you can control and manipulate text using text frames. The source code for the sample programs shown here can be found in the Samples\vb6\TextFrames folder.

An overview of all properties, methods and events which can be used in conjunction with text frames can be found at Images, Text Frames and OLE Objects. Properties which have a name that begins with "Object" can be used with text frames as well as other kinds of embedded objects, like images and OLE objects, whereas those starting with "TextFrame" only apply to text frames.

Inserting a Text Frame

Printing Labels


Inserting a Text Frame

TX Text Control provides three different methods for inserting text frames:

  • The TextFrameInsert method is the default method for inserting text frames. A text frame inserted with this method will be anchored to a paragraph. Text can flow around the frame, and the frame will move with the paragraph.
  • Text frames inserted with the TextFrameInsertAsChar method are handled like a single character in the text. This method is often used to insert small data entry fields.
  • The TextFrameInsertFixed method inserts a text frame at a fixed position on the page. The text frame keeps its position regardless of changes made to the surrounding text.

The first sample program shows how to insert a text frame using TextFrameInsert. The source code for this sample program can be found in the Samples\vb6\TextFrames\Inserting Text Frames folder.

The sample program has two menu items, one of which calls TX Text Control's TextFrameInsert method to create a text frame, and the other one calls ObjectAttrDialog to open a settings dialog box.

[Visual Basic 6]
Private Sub mnuTextFrame_Insert_Click()
    TXTextControl1.TextFrameInsert -1, 0, 0, 0, 1000, 1000, 3, 20, 20, 20, 20
End Sub

Private Sub mnuTextFrame_Settings_Click()
    TXTextControl1.ObjectAttrDialog
End Sub

Text frames can be moved and resized by dragging them with the mouse. Clicking on the border of a text frame selects and activates it. After a text frame has been selected, its Settings dialog box can be opened by clicking the Settings menu item.

TX Text Control's ObjectAttrDialog method can be used on all types of insertable objects, including text frames, images and OLE objects. To prevent the dialog box from being displayed when no text frame has been selected, the corresponding menu item is only enabled after a text frame has been clicked on. This is done in the sample program's mnuTextFrame_Click event handler:

[Visual Basic 6]
Private Sub mnuTextFrame_Click()
    mnuTextFrame_Settings.Enabled = (TXTextControl1.ObjectGetSelected(&H20) <> 0)
End Sub

ObjectGetSelected is another method that can be used with all insertable objects. Its parameter determines which type of object to look for.


Printing Labels

This sample program shows how to insert multiple text frames simultaneously. The application is a label printing program, used to print, for instance, address labels or badges. The source code for this sample program can be found in the Samples\vb6\TextFrames\Printing Address Labels directory

The sample program contains a dialog box for entering information about the label sheet to be used, e.g. the number of labels and their dimensions.

The program then creates a text frame for each of the labels.

The text frames can them be filled out, either manually by clicking on a field and typing in text, or from a file or database. When you click on the Fill in menu item, the sample program will enter the words "Address no." followed by the field identifier into each of the frames.

To load text from a file instead, simply replace the .Text property with a call to TX Text Control's Load method.

[Visual Basic 6]
Private Sub mnuLabel_FillIn_Click()
    Dim FrameID As Integer

    FrameID = tx.ObjectNext(0, &H20)
    While FrameID
        tx.TextFrameSelect (FrameID)
        tx.Text = tx.Text = "Address no. " & FrameID
        tx.TextFrameSelect 0
        FrameID = tx.ObjectNext(FrameID, &H20)
    Wend
End Sub


XML Basics

The purpose of this chapter is to help you get started with Text Control Enterprise and its XML features. It will show you how to open an XML file, and how to use it in conjunction with a CSS style sheet and a DTD.

There is a more detailed description of Text Control's XML related properties and methods in the Technical Articles section, see Working with XML Files.

The source code for this example is contained in the Samples\vb6\XMLBasics sample source directory.

The Sample Program

The XML File

The CSS File

The DTD File


The Sample Program

The sample program has only one menu item, which is Open File. Looking at the source code reveals nothing unusual: The main difference to the Open File routine in other Text Control sample programs is the Load method's Format parameter. It has a value of 10 to indicate that we want to laod an XML file:

[Visual Basic 6]
With CommonDialog1
   .Filter = "*.xml"
   .Flags = cdlOFNFileMustExist Or cdlOFNHideReadOnly
   .CancelError = True
   .ShowOpen
   If .FileName <> "" Then
      TXTextControl1.Load .FileName, , 10
   End If
End With

There is quite a bit happeing behind the scenes, however. If you load the TestFile.xml sample file, Text Control will not only load the xml file, but will

  • automatically validate it using the enclosed DTD, and
  • format it according to the CSS stylesheet provided.

Let us take a closer look at the 3 files involved.


The XML File

The XML file contains a simple list of addresses:

<?xml version="1.0"?>
<? XML:stylesheet type="text/css" href="address.css"?>
<!DOCTYPE address SYSTEM "address.dtd">
<address>
   <address_record>
      <name>Paul</name>
      <street>Baker Street</street>
      <city>London</city>
      <email>paul@hotmail.com</email>
   </address_record>
   <address_record>
      <name>George</name>
      <email>george@hotmail.com</email>
   </address_record>
</address>

Note that, unlike an HTML or RTF file, an XML file does not contain any information about how the text is to be displayed or formatted.


The CSS File

In line 2 of the XML file (above), you can see a reference to a stylesheet file called address.css. This CSS file tells Text Control that an address entry should be displayed as a table, and that the individual elements are table cells, having a 1 pixel wide border and a font size of 1 point:

address { display: table }
address_record { display: table-row}
name, street, city, email {	display: table-cell; border: 1px; font-size: 11pt }

When you load address.xml with the sample program, Text Control will display it according to this stylesheet.

Changing the CSS file can make the text appear in a completely different way. For instance, a list can be used instead of a table, as in this example:

name {	display: block; font-size: 14pt; color: blue }
street, city, email { display: list-item; font-size: 11pt}

This is how Text Control will display the XML data using the new sylesheet:


The DTD File

The DTD specifies which elements may occur in an XML file, and in which way the elements should be ordered or nested. The sample DTD specifies that an address contains one or more address_record elements, which in turn can contain a name, street, city, and email. street and city are defined as optional elements.

<!ELEMENT address ( address_record+ )>
<!ELEMENT address_record ( name, street?, city?, email )>
<!ELEMENT name (#PCDATA )>
<!ELEMENT street (#PCDATA )>
<!ELEMENT city (#PCDATA )>
<!ELEMENT email (#PCDATA )>

When loading an XML file, Text Control checks whether the XML code is valid, i.e. adheres to the rules specifed in the DTD. An error will occur if it does not, like in this example, where the required <name> has been removed:

<?xml version="1.0"?>
<? XML:stylesheet type="text/css" href="address.css"?>
<!DOCTYPE address SYSTEM "address.dtd">
<address>
   <address_record>
      <street>Baker Street</street>
      <city>London</city>
      <email>paul@hotmail.com</email>
   </address_record>
</address>

Loading the above XML code will raise an error:

This strict error checking is considered one of the major strengths of XML, as it ensures that a document will always have a certain structure, and thus can be processed by other applications.


Editing in XML Mode

This chapter looks at some of the differences between normal text editing and editing an XML file.

The source code for this example is contained in the Samples\vb6\XMLEditing sample source directory.

The Sample Program

Run the sample program and load the demo file address_list.xml. You will notice that there is now a button bar with 3 combo boxes:

You don't need to create the combo boxes yourself, they are built into Text Control's Button Bar.

The first combo box displays the style of current XML field. If you move down the caret by pressing the down arrow key, the display will change from name to street, city and email, depending on what type of field you are in.

With the second combo box, additional XML fields can be inserted.

You can select to either insert a complete address record, or one of the optional elements, which are street and city. Depending on the DTD, not all elements can be inserted at all positions. For instance, if you click on the name Paul in the first line of the document, and try to insert a street, an error will occur, because this record already contains a street. Try again with Ringo, and it will work.

The third combo box is for deleting XML fields. Again, every action is checked with the DTD, so that you can be sure not to invalidate your document by, for instance, deleting a required field.


Using Microsoft Word Fields

TX Text Control imports and exports all fields that can be inserted into an MS Word document. As described in the technical article, the TXTextControl.FieldType and the associated TXTextControl.FieldTypeData property must be used to create a valid field.

The following two samples show how to use the two most common used fields of MS Word: MERGEFIELD and FORMTEXTBOX.

The source code for these samples is contained in the following directory:

  • Samples\VB6\ApplicationFields
  • Samples\VB6\ApplicationFields

Implementing a MERGEFIELD Class

Implementing a FORMTEXT Class


Implementing a MERGEFIELD Class

The MS Word MergeField is the most commonly used field in MS Word and RTF documents. It enables template designers to add additional information to a text field, such as a specific text that should be displayed before or after the field text or the format of the text.

To handle these fields and functionality, this sample implements a class that gets and sets the parameters of the TXTextControl.FieldTypeData.

This MergeField gets a reference to the TXTextControl.FieldCurrent property to manipulated the proper field in TX Text Control. Additionally, a MergeField contains the following parameters that are implemented through it's properties:

  • TextFormat
  • TextBefore
  • TextAfter
  • Mapped
  • MergeFieldName
  • PreserveFormatting
  • VerticalFormatting

If the TextBefore property of the MergeField is set, the Text property of this class manipulates the referenced field and it's text. Additionally, this new setting is saved in the TXTextControl.FieldTypeData property in the appropriate format.

After starting the sample, click on File / Load to load a sample document, which contains several merge fields. Set the input position inside an exsiting field, for sample <<COMPANY>>.

Open the implemented merge field dialog by choosing Edit... from the MergeField main menu.

Using this dialog, it is possible to manipulate all properties of the MergeField instance. Add some text that should be inserted after the field by checking the checkbox Text to be inserted after. Type some text in the appropriate text box and close the dialog by clicking OK.

Select Merge fields... from the Merge menu entry to merge all merge fields with database content.

In this process, the TXTextControl.FieldNext property is used to loop through all inserted fields to replace the text. The following code shows this loop:

[Visual Basic]
oID = TXTextControl1.FieldNext(oID, &H8000)
Do While oID > 0
  Dim newMergeField As New MergeField
  Set newMergeField.TextControl = TXTextControl1
  newMergeField.FieldID = oID
  newMergeField.GetParameters
  For i = 0 To rs.Fields.Count - 1
    If StrConv(rs.Fields(i).Name, vbLowerCase) = StrConv(newMergeField.MergeFieldName, vbLowerCase) Then
      If rs(i).value <> "" Then
        newMergeField.Text = rs(i).value
      End If
    End If
  Next
  newMergeField.UnLoad
  oID = TXTextControl1.FieldNext(oID, &H8000)
Loop


Implementing a FORMTEXT Class

The FormText field is used in MS Word to create fillable documents. In many applications, such documents are automated, so that these fields must be readable to be completed automatically. A TX Text Control field acts like a container for all settings (switches) of these fields.

This sample implements a class for the FormText fields. Everytime, a field of type FORMTEXT should be edited, a new FormText object is created:

[Visual Basic]
Dim newMergeField As New MergeField
Set newMergeField.TextControl = TXTextControl1
newMergeField.FieldID = oID
newMergeField.GetParameters

A reference to the TXTextControl.FieldCurrent is stored in the FormText instance. Similar to the first sample, this identifier is used to get or set the parameters that are mapped to the properties of the new implemented FormText object.

A dialog box is implemented to change the properties of the specific form text field. The dialog represents the properties of the implemented FormText field:

After clicking OK, the specified values in the dialog box are set in the implemented FormText object which writes the parameters of the referenced field of TX Text Control.


Internet Explorer User's Guide

This chapter describes how to use TX Text Control with the Microsoft Internet Explorer.

Browser Based vs. Traditional Applications

Creating ActiveX Documents in Visual Basic

Using Text Control with HTML and VBScript

How to obtain a code signed CAB File


Browser Based vs. Traditional Applications

Traditional applications need to be installed on every single computer on a network. Each time a new computer is added, or a hard disk has crashed, the system administrator has to walk to that machine, insert all the CDs, and re-install all the programs. This makes up a major part of what IT managers call "total cost of ownership" - the manpower required to keep a network of computers up and running.

One of the most promising ways to solve this problem is to let all software run in a browser. The process works pretty much like with the browser plugins for audio files or PDF documents: When you click one of these files for the first time, the appropriate plugin is downloaded and installed, and the file can be processed instantly.

Of the various ways to create browser based applications, two are especially well suited for working with ActiveX controls, like Text Control:

If you are a Visual Basic programmer, you will find it straightforward to use ActiveX documents. ActiveX documents are created with Visual Basic 6, just like normal .exe programs. This is shown in Creating ActiveX Documents in Visual Basic.

If you feel more comfortable writing HTML code, then you will prefer to insert Text Control as an ActiveX object into your HTML page, and do the programming with a script language. You don't need any special tools for this, just a simple text editor. Using Text Control with HTML and VBScript shows you how to do it.


Creating ActiveX Documents in Visual Basic

Creating a new Project

How it Works

Creating a CAB File

Editing the HTML File

Running the Program


Creating a new Project

To create an ActiveX Document, start Visual Basic and select ActiveX Document Exe in the New Project dialog box.

Then continue adding a Text Control to your project and writing code, just as if you were to create a Standard EXE application.


How it Works

The code (below) is the complete source code for our first sample program. If you compare it to a similar VB sample program which runs as an .exe, you will notice 2 differences:

  • The toolbars are connected in the UserDocument_Initialize Event, instead of the Form_Load event.
  • Loading and saving files is done through the Property Bag. For detailed information about Property Bags and ActiveX document programming in general, refer to the VB documentation, and search http://www.msdn.microsoft.com/ for ActiveX Document.
[Visual Basic 6]
Private Sub mnuAbout_Click()
   frmAbout.Show vbModal
End Sub
Private Sub TXTextControl1_Change()
   PropertyChanged "TextData"
End Sub
Private Sub UserDocument_Initialize()
   TXTextControl1.ButtonBarHandle = TXButtonBar1.hWnd
   TXTextControl1.StatusBarHandle = TXStatusBar1.hWnd
   TXTextControl1.RulerHandle = TXRuler1.hWnd
End Sub
Private Sub UserDocument_Resize()
   TXTextControl1.Height = ScaleHeight _
      - TXButtonBar1.Height - TXStatusBar1.Height _
      - TXRuler1.Height
End Sub
Private Sub UserDocument_ReadProperties(PropBag As PropertyBag)
   Dim TextData() As Byte
   TextData = PropBag.ReadProperty("TextData", "")
   TXTextControl1.LoadFromMemory TextData, 9
   UserDocument_Resize
End Sub
Private Sub UserDocument_WriteProperties(PropBag As PropertyBag)
   Dim TextData() As Byte
   TextData = TXTextControl1.SaveToMemory(9)
   PropBag.WriteProperty "TextData", TextData
End Sub


Creating a CAB File

Text Control comes with a pre-built CAB file, but, as we need to create a CAB file for the ActiveX document anyway, we simply include the Text Control files there, and do not use the pre-built CAB.

The CAB file is created with Visual Basic's Package and Deployment Wizard. Having started it, follow these steps:

  • Select the project file, which is ..\Ie\ActiveX Document\Project1.vbp for the sample program.
  • Click on Package, and then select Internet Package.

The Wizard will create a CAB file, a document file, and a HTML file. All required Text Control files will be included automatically.


Editing the HTML File

The HTML file which has been generated by the Package and Deployment Wizard needs to be edited, so that it will properly register the Text Control ActiveX. The VB documentation states that the HTML file is only required if you use Internet Explorer 3, and that you can use the .vbd file instead if you have IE 4 or later. However, this is not true if the document contains ActiveX controls. ActiveX controls need to be included by their class ID in an Object tag. This is the modified HTML code:

<HTML>
<HEAD>
   <TITLE>Project1.CAB</TITLE>
</HEAD>
<BODY>
Loading ...
<OBJECT ID="UserDocument1"
   CLASSID="CLSID:b89a2c00-99dd-11e6-a5ed-0013d350667c"
   CODEBASE="Project1.CAB#version=9,9,9,9">
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
Sub Window_OnLoad
   Document.Open
   Document.Write "<FRAMESET>"
   Document.Write "<FRAME SRC=""UserDocument1.VBD"">"
   Document.Write "</FRAMESET>"
   Document.Close
End Sub
</SCRIPT>
</BODY>
</HTML>


Running the Program

Having modified the HTML code, the 3 files can be put anywhere on your local hard disk, on a file server, or on a HTTP server. All that a user has to do in order to start the program is to point his browser to the HTML file. Internet Explorer will automatically download and install the CAB file, and start the program.


Using Text Control with HTML and VBScript

The Object Tag

Step 1 - Displaying a Text Control on a HTML Page

Step 2 - Programming with VBScript

Step 3 - Handling Events

Step 4 - Loading a File

Step 5 - Printing

Step 6 - Working with CAB Files


The Object Tag

As an alternative to creating ActiveX Documents with Visual Basic, Text Control can also be used directly as an ActiveX object in HTML code. To include a Text Control in HTML code, it is declared as an object:

<OBJECT
  classid="clsid:b89a2c01-99dd-11e6-a5ed-0013d350667c"
  id=objTX
  width=600
  height=400
  >
  <PARAM NAME="ViewMode" VALUE="2">
  <PARAM NAME="ScrollBars" VALUE="3">
  <PARAM NAME="PageWidth" VALUE="12240">
  <PARAM NAME="PageHeight" VALUE="15840">
</OBJECT>

The "classid=" statement specifies Text Control's class ID, which Internet Explorer can use to locate it. (Note that this declaration requires that a Text Control has already been installed on your computer. We will later add a CAB file reference so that it can automatically be loaded and installed from a file server or the Internet.) The "id=objTX" statement assigns a name to the object which is used to access it from program code. The remaining lines set the width and height, and assign some initial values to some of Text Control's properties.


Step 1 - Displaying a Text Control on a HTML Page

Little more than the <OBJECT> tag is required in order to display a Text Control on a HTML page. Only the minimum HTML declarations need to be added:

<HTML>
<HEAD>
  <TITLE>A Simple First Page</TITLE>
</HEAD>
<BODY>
<OBJECT
  classid="clsid:b89a2c01-99dd-11e6-a5ed-0013d350667c"
  id=objTX
  width=600
  height=400
  >
  <PARAM NAME="ViewMode" VALUE="2">
  <PARAM NAME="ScrollBars" VALUE="3">
  <PARAM NAME="PageWidth" VALUE="12240">
  <PARAM NAME="PageHeight" VALUE="15840">
  <PARAM NAME="Text" VALUE="Text Control running in Internet Explorer">
</OBJECT>
</BODY>
</HTML>

The code shown here is contained in Step1.htm in the \IE\HTML sample source directory. Open the file in Internet Explorer to run the sample program.


Step 2 - Programming with VBScript

Having created a Text Control object on our HTML page, we now need a way to access its methods and properties. Internet Explorer supports VBScript, which is a subset of the Visual Basic programming language. All you need to create a VBScript program is a text editor, and the VBScript Language Reference which is available for download on Microsoft's web site.

As a simple example on how VBScript works, we add a button to our sample program from Step 1, and let it write some text in the Text Control window when you click on it.

A button is created in the BODY section of our HTML page like this:

<FORM>
  <INPUT NAME="Button1" TYPE="BUTTON" VALUE="Click me!">
</FORM>

In the HEADER part, we add some VBScript code to process the button's OnClick event:

<SCRIPT LANGUAGE="VBScript">
<!--
Sub Button1_OnClick
  objTX.Text = "Thanks for clicking me!"
End Sub
-->
</SCRIPT>

When the button is clicked on, the script code is executed and assigns some text to Text Control's Text property. All of Text Control's properties and methods can be used like this.

The code shown here is contained in Step2.htm in the \IE\HTML sample source directory.

Now you probably want to add a ButtonBar or a StatusBar. This is a little tricky in IE. There is no event like the Form_Load event in VB. You can't use the <BODY onLoad="..."> event, this is called before the two objects have been created.

But Text Control offers a solution. You can use the BODY onLoad event to set the ButtonBarHandle to 1. This tells TX that you want to set these handle when all controls have been created. So, Text Control fires an event called ConnectTools, when it's ready to receive the handles. The code to do that looks like the following:

<HTML>
   <HEAD>
      <TITLE>A Simple First Page</TITLE>
      <SCRIPT LANGUAGE="VBScript">
      <!--
      Sub Load()
         objTX.ButtonBarHandle = 1
      End Sub
      Sub objTX_ConnectTools()
         objTX.ButtonBarHandle = objBB.hWnd
      End Sub
      -->
   </SCRIPT>
</HEAD>
<BODY onLoad="Load()">

Where objBB is the ButtonBar object. The class ids for the additional ActiveX controls are:

Button Bar: clsid:b89a2c09-99dd-11e6-a5ed-0013d350667c
Status Bar: clsid:b89a2c11-99dd-11e6-a5ed-0013d350667c
Ruler Bar:  clsid:b89a2c0d-99dd-11e6-a5ed-0013d350667c

Another way to solve this special problem is to build a custom ActiveX control that wraps the TextControl and/or a Button Bar/Status Bar/Ruler Bar.

The code shown here is contained in Step2.htm in the IE\HTML sample source directory.


Step 3 - Handling Events

If you are familiar with Visual Basic, then you should have no problem setting up event handlers in a web page. Event handlers are code that is called when a particular action is performed on or performed by a component. For example, let's say that you wish to perform an action whenever the user clicks on a field in the TX Text Control. You would setup an event handler for the FieldClicked event as follows:

<SCRIPT ID="EventHandlers" LANGUAGE="vbscript">
<!--
   Sub objTX_FieldClicked(ByVal FieldId)
      msgbox "A field has been clicked. Field identifier: " & FieldId
   End Sub
-->
</SCRIPT>

We recommend that script code that accesses components always be placed after the object tags of OCX components. But this is not necessary with event handler code as this code will not be called until a component is initialized.

Since Internet Explorer's VBScript does not support variable types, you cannot use variables such as Long, Boolean, Double, Integer, etc in your code. All variables in VBScript are Variants. Therefore, the following code would be incorrect and would generate a script error.

Sub objTX_FieldClicked(ByVal FieldId as Integer)

Use the following code instead, omitting any "as Integer" or other variable types...

Sub objTX_FieldClicked(ByVal FieldId)

Anyway, the parameter of the FieldClicked event can be easily accessed by VBScript, because it casts automatically the variable into the correct variable type.

The code shown here is contained in Step3.htm in the IE\HTML sample source directory.


Step 4 - Loading a File

Now that we know how to display a Text Control and access its properties, we can take care of some of the functions required in most word processing applications, which are file handling and printing.

To load a file, we first need to display a Common Dialog box which lets the user select the file to be opened. The common dialog box is added to the HTML page as an ActiveX object, just like the Text Control in Step 1:

<OBJECT
  classid="clsid:F9043C85-F6F2-101A-A3C9-08002B2F49FB"
  id=objComDlg
  >
</OBJECT>

In our button's OnClick event, we call objComDlg.ShowOpen to show the dialog box, and then, after the user has selected a filename, open the file in Text Control.

Sub Button1_OnClick
   on error resume next
   objComDlg.Filename = ""
   objComDlg.Filter = "Microsoft Word Format " & _
         "(*.doc)|*.doc|" & _
         "Rich Text Format (*.rtf)|*.rtf|" & _
         "Hypertext Markup Language " & _
         "(*.htm, *.html)|*.htm;*html|" & _
         "Text Documents (*.txt)|*.txt"
   objComDlg.ShowOpen
   if err.number = 0 then
      If UCase(Right(objComDlg.FileName, 3)) = "DOC" Then
         objTX.Load objComDlg.Filename,0,9,0
      elseIf UCase(Right(objComDlg.FileName, 3)) = "RTF" _
      Then
         objTX.Load objComDlg.Filename,0,5,0
      elseIf UCase(Right(objComDlg.FileName, 3)) = "HTM" _
      or UCase(Right(objComDlg.FileName, 4)) = "HTML" Then
         objTX.Load objComDlg.Filename,0,4,0
      else
         objTX.Load objComDlg.Filename,0,1,0
      end if
   end if
End Sub

The code shown here is contained in Step4.htm in the IE\HTML sample source directory.


Step 5 - Printing

Printing works pretty much like loading a file: We first open a Common Dialog box (this time with objComDlg.ShowPrint instead of objComDlg.ShowOpen), and then pass the selected settings on to Text Control's PrintDoc method.

The code shown here is contained in Step5.htm in the IE\HTML sample source directory.


Step 6 - Working with CAB Files

One of the advantages of letting your application run in a web browser (instead of as a stand-alone .exe) is that there is no need to install it on each of the client's computers. This would be, of course, of little use if you still need to install Text Control. For this reason, Text Control is also available as a CAB file, which is automatically downloaded and installed when needed. Two changes are required to our sample program of Step 4 in order to make use of the CAB file

1. An additional OBJECT tag is inserted for a .lpk file. This file is not Text Control specific, but includes license information for all ActiveX controls you use on a HTML page in encrypted form. It must be in the same directory as the .html file.

<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331" VIEWASTEXT>
  <PARAM NAME="LPKPath" VALUE="tx.lpk">
</OBJECT>

The .lpk file can be created by using a program called Lpk_tool.exe, which is included in the Microsoft ActiveX SDK that is available for download from www.microsoft.com.

2. TX Text Control's OBJECT tag is extended by a reference to the CAB file. You can put the CAB file anywhere on a file server or on a web server. The codebase = statement (below) needs to be updated with the respective path to the CAB file on your server.

<OBJECT
  classid="clsid:b89a2c01-99dd-11e6-a5ed-0013d350667c"
  codebase="http://myserver.com/.../tx.cab"
  id=objTX
  width=600
  height=400
  >
  <PARAM NAME="ViewMode" VALUE="2">
  <PARAM NAME="ScrollBars" VALUE="3">
  <PARAM NAME="PageWidth" VALUE="12240">
  <PARAM NAME="PageHeight" VALUE="15840">
  <PARAM NAME="Text" VALUE="TX Text Control ActiveX in Internet Explorer">
</OBJECT>

You may like to test this sample application, running from your own hard disk. Depending upon where you have installed TX Text Control, the path to the CAB file in the object tag should look something like this:

codebase="file:///C:/Program Files/Text Control GmbH/TX Text Control 22.0/Cab/TX.CAB"

The code shown here is contained in Step6.htm in the IE\HTML sample source directory.


How to obtain a code signed CAB File

Text Control's setup program has copied a CAB file to your Program Files\...\TX Text Control\Cab folder. This CAB file includes all required Text Control files, and is suited for most applications, including a distribution in an intranet or from a file server.

However, it has not been code signed, and therefore Internet Explorer will issue a security warning when you install it from the Internet.

A code-signed CAB file which can be installed without generating such warnings is available free of charge at http://www.textcontrol.com/in/CabFileRequest.htm.


ASP User's Guide

Demonstrates the usage of the TX Text Control features in the Microsoft Internet Information Server with ASP.

Using Text Control with ASP and VBScript

Prerequisites

Simple Sample Programs

Online Store - An Advanced ASP Example


Using Text Control with ASP and VBScript

This chapter shows you how to use Text Control on a server.

When running on a server, Text Control is switched to a special mode so that it does not have a user interface. There is no editing window, no toolbars and no ruler. No dialog boxes nor error messages will be displayed. It is completely invisible to the user, and all editing and processing is done from code.

At first glance it may seem strange to have an editor running where it is hidden from the user, but there are many applications where documents need to be processed from code rather than interactively:

  • Documents can be assembled from various sources, like text files (ASCII, RTF, HTML, DOC, XML) and image files (BMP, TIFF, WMF, JPEG, PNG, GIF).
  • Information can be filled in from a database. An example for this is the automatic generation of nvoices and order confirmations, as shown in the Online Store sample program.
  • Documents can be converted to RTF, HTML, DOC or PDF, and then either saved to a file or database, or sent via email or HTTP.
  • XML data can be converted to HTML and other formats on-the-fly. Documents can be stored in a single format, and converted as requested by users.
  • Batch processing and batch printing of large volumes of documents is supported.
  • All word processing functions normally available from menu items and dialog boxes can be applied from code. Options include find&replace, fonts, paragraph indents and alignment, inserting tables and images, and many more. Just like a piece of text is selected with the mouse, it can be selected from code, for instance to underline it or change its text color.

Instead of the word processor interface common to client applications, server based programs often communicate with the user via HTTP. The user enters some information on a web page, which is sent to the server, processed on the server, and then sent back as, say, a PDF file containing an invoice. Some applications may not have a user interface at all, for instance when used for batch processing of large amounts of files, or batch print jobs.


Prerequisites

Internet Information Server (IIS) needs to be installed in order to run Text Control in server mode. It can be run on a dedicated server, or by simply activating IIS on the developer's computer. An application can be developed and tested on a single computer, and later moved to a dedicated server. Text Control supports IIS, version 5 or higher, running on Windows 2000, Windows XP, Windows Vista, Windows 7, Windows Server 2003 or Windows Server 2008.


Simple Sample Programs

Installing the Samples

Creating a Text Control in a Server Side Script

Generating Dynamic Content

Step 1 - Generate a PDF File

Step 2 - Insert a Table

Step 3 - Format Text

Step 4 - Format Tables

Step 5 - Merge multiple Documents

Step 6 - Print a Document

Performance Considerations

What Comes Next


Installing the Samples

To run the installed sample code, you have to set up a virtual directory in your Internet Information Server. To do so, perform the following steps:

  • Start the Internet Information Server Administration Tool. The location of this tool depends on the operating system.
  • Select Default Web Site in the left tree view and then the Action/New/ Virtual Directory... menu item. This will start a wizard.
  • On the first page, Virtual Directory Alias, specify tx as an alias name and press the Next button.
  • On the second page, Web Site Content Directory, select the Samples\Asp subdirectory found in your TX Text Control installation path. Press the Next button.
  • On the third page, Virtual Directory Access Permissions, enable Write permission for the virtual directory and press Finish.

Now you can test the installation by opening your browser and browsing to http://<your_machine_ip>/tx, where <your_machine_ip> is the IP address or host name of your server. The index page index.htm located in the Samples\Asp subdirectory is shown.


Creating a Text Control in a Server Side Script

An instance of a Text Control is created by calling the Server.CreateObject function:

Dim lc, tx
set lc = Server.CreateObject("TIS.TX.LicManager.24")
set tx = Server.CreateObject("TIS.TX.TextControl.24")
tx.EnableAutomationServer

Before creating the Text Control object, a license manager object must be created that reads Text Control's license information from the registration data base. This information is necessary to create a Text Control object.

The EnableAutomationServer method initializes the Text Control object as an automation server. The remaining lines set the width, height and page margins of a Text Control document.


Generating Dynamic Content

One of the most common tasks for a web developer, is to write dynamic document content. In some cases, it is necessary to generate print-ready documents, for example invoices or quotes. The following steps 1 to 6 illustrate some of these tasks with short example scripts. The scripts can all be found in the Samples\Asp\Simple subdirectory, named step1.asp to step6.asp.


Step 1 - Generate a PDF File

The first sample script, step1.asp, begins with a few lines of code which show how to generate PDF documents on-the-fly.

Dim lc, tx
set lc = Server.CreateObject("TIS.TX.LicManager.24")
set tx = Server.CreateObject("TIS.TX.TextControl.24")
tx.EnableAutomationServer
...
tx.Text = "The quick brown fox jumps over the lazy dog."
' Save in Adobe pdf format (format identifier 12)
tx.Save Server.MapPath("demo.pdf"), 0, 12

The sample code above creates a document with the given text and writes it to the server as a PDF file. The output of the script provides a link to the generated document. You need Adobe Reader to view this file in your browser.

Please note the call to the MapPath method of the Server object. This method converts a virtual file name to the fully qualified path of the file system. Without the MapPath call TX Text Control would try to write he file to the current directory, because it cannot handle virtual file names. Due to the access restrictions of the anonymous internet user, calling the Save method would fail, as this user does not have permission to write to the current directory.

The format identifiers used with the Save method are listed in the reference description for this method.


Step 2 - Insert a Table

In the second step, step2.asp, a more advanced document is generated. A table is inserted and its cells are filled with text.

tx.TableInsert 2, 2, -1, 11	' inserts a 2x2 table
tx.TableCellText(11, 1,1) = "Cell 0,0"
tx.TableCellText(11, 1,2) = "Cell 0,1"
tx.TableCellText(11, 2,1) = "Cell 1,0"
tx.TableCellText(11, 2,2) = "Cell 1,1"

The TableInsert method is used to add a table to the generated document. The last parameter of this method is a unique identifier for the table. This identifier can be used to alter the table or its cells dynamically. The example uses this identifier as a parameter to TableCellText to address the previously inserted table.

Furthermore there is also another interesting code fragment that deals with PDF output. As you can see, the generated document is not saved in a file. The sample script sends the PDF output directly to the client's browser:

binPDF = tx.SaveToMemoryBuffer (binPDF, 12, 0)
Response.Clear
Response.ContentType = "application/pdf"
Response.BinaryWrite(binPDF)

With the SaveToMemoryBuffer method the document is stored in a memory buffer identified through the binPDF variable. Using this it is possible to send the whole document to the client's browser. It also could be encoded and sent as attachment via e-mail.


Step 3 - Format Text

This third step shows how text can be formatted. With Text Control's text formatting properties, the complete layout of a document can be controlled.

tx.FormatSelection = true
tx.FontSize = 17
tx.FontName = "Times New Roman"
tx.SelText = "TX Text Control Step 3" & vbCrLf

This example alters the font name and size at the current input position and inserts a line of text. The new line is formatted with the previously specified attributes. You can also select a text fragment with the SelStart and SelLength properties and alter any attribute of a character or paragraph after inserting text. For a detailed overview of all properties that handle formatting attributes see Programming Categories - Character Formatting and Programming Categories - Paragraph Formatting.


Step 4 - Format Tables

TX Text Control offers full control of table layout, like border width, background color, and distances between a cell's text and its border. The code in the fourth example formats each cell of the table added in step 3, using the TableCellAttribute property.

tx.ObjectInsertAsChar 0, Server.MapPath("x.jpg"), _
            tx.TableCellStart(11, 1 ,1)-1, 100,100, 0, 1
tx.TableCellAttribute(11, _
            1, 1, txTableCellHorizontalExt) = 1500
tx.TableCellAttribute(11, _
            1, 1, txTableCellRightBorderWidth) = 20
tx.TableCellAttribute(11, _
            1, 1, txTableCellBottomBorderWidth ) = 20
tx.TableCellAttribute(11, _
            1, 1, txTableCellTextGap) = 50

This code first inserts an image at the first position of the first cell. The ObjectInsertAsChar method inserts an image that acts like a character.

ObjectInsertAsChar expects the text position at which the image is to be inserted as its third parameter. The table's first cell is modified with the TableCellAttribute property. The width of the cell is set to 1500 twips, a border is set for the right and the bottom of the cell, and cell padding of 50 twips is set. There are many more possibilities to manipulate a table's layout. See Programming Categories - Tables for more information.


Step 5 - Merge multiple Documents

A very useful feature of TX Text Control is the capability to merge documents with different text formats into one document. For instance, you can generate a new document from code and add a Microsoft Word document or a document formatted with another supported format to this document. There are several cases when such a feature is useful, e.g. generating an invoice and adding legal information to it.

The following code fragment sets the current input position to the end of the current document and appends the demo document installed with the TX Text Control installation program:

tx.SelStart = Len(tx.Text)
tx.SelLength = 0
' add a page break
tx.SelText = Chr(12)
' insert the demo document
tx.Load Server.MapPath("demo.rtf"), 0, 5, true

As you can see, the Load method has three additional parameters, besides the file name of the document. The first specifies the zero-based file position from where the data is to be read (in this case 0, because the complete demo document is added). The second specifies the format identifier and the last parameter is a boolean value, which must be set to True if a document is to be inserted. Otherwise, if set to False the merged document would replace the current document.


Step 6 - Print a Document

Sometimes you need to print a generated document on the server, e.g. to generate an invoice. VBScript does not support the Visual Basic printer object or any similiar functionality to select printers, paper bins etc. It is possible, however, to send your document to the default printer. This can be achieved with the following single line of code:

...
tx.PrintDoc "ASP Document Title", 1, tx.CurrentPages(), 1
...

The PrintDoc method prints the contents of the Text Control to the system's default printer. The first parameter specifies the document's title in the printer's queue, the following are the first and the last page to print. The last parameter specifies the number of copies. This sample code can be found in the 'step6.asp' sample script.

If you want to print to a file, add a printer driver to your system, which supports the desired output format, e.g. a Postscript driver. Add a new Local Port to your printer configuration and specify a file name for the port, e.g. c:\out.ps. The output of this printer driver is redirected to the specified file. The file will be overwritten each time you print to this printer driver.


Performance Considerations

A Text Control should be used in page scope to achieve the maximum performance. Page scope means, that a Text Control is created for a single Active Server Page and will be alive until this page is processed.

It is not recommended to use a Text Control in session or application scope, because this can decrease the performance of Internet Information Server. The Session or Application object will be locked down to a single thread.


What Comes Next

The next sample, Online Store, will demonstrate the functionality of TX Text Control in a real world application.

For additional information on how to integrate special features, have a look at the source code of the Visual Basic sample programs. Almost all Text Control properties and methods can be used with the exception of those needing a visible surface like dialog boxes, toolbars and all features manipulating the display of a document. For a list of properties and methods that cannot be used, see Technical Articles - Server Programming.


Online Store - An Advanced ASP Example

This example shows how to use TX Text Control to create documents on-the-fly without any server-side user interaction. It uses input information from a web site, creates a document and returns a print-ready PDF document. You will find this sample in the Samples\Asp\OnlineStore directory.

The Sample Program

The example environment is an online store shopping cart where the user can specify the quantity of articles in the cart. After specifying the postal address and pressing the Order button, the data is used to create an order confref_descirmation on the server. The data is sent to the server using the HTTP POST variables where the ASP script creates a Text Control object.

<form action="create_confirmation.asp" method="post" ID="Form1">

First of all, a template document is loaded that already contains the design of the invoice. The template generation is omitted for clarity in this sample. If you want to know more about template generation, please have a look at the Mail Merge sample in the Visual Basic User's Guide.

' Load a template file
tx.Load Server.MapPath("template.tx")
' Merge the marked text fields with the posted data
tx.FieldCurrent = 1
tx.FieldText = request.form("company")
tx.FieldCurrent = 2
tx.FieldText = request.form("street")

Mail merge is then performed on the fields already present in the template, filling them with values like name or address. The fields were inserted with the template generator and they are used as placeholders for the form's data. For a detailed ref_descoverview of all text field capabilities see Technical Articles - Marked Text Fields.

Now it is time to put the ordered items into a table. The table is also an element of the template document. For each item whose quantity is greater than zero, a new line is inserted into the table and the item's product description is copied to ref_descthe new row.

For i = 1 To request.form("article_amount")
   If(request.form("article" + CStr(i) + "_qty") <> 0) Then
      tx.SelStart = tx.TableCellStart(TableID, _
               tx.TableRows(TableID), 1)
      tx.TableInsertLines 2, 1
      tx.TableCellText(TableID, CurrentRow, 1) = _
               request.form("article" + CStr(i) + "_qty")
      tx.TableCellText(TableID, CurrentRow, 2) = _
         request.form("article" + CStr(i) + "_ordernumber")
      tx.TableCellText(TableID, CurrentRow, 3) = _
         request.form("article" + CStr(i) + "_description")
      article_sum = request.form("article" _
                     + CStr(i)+"_qty") _
               * request.form("article" + CStr(i) + "_price")
      TotalSum = TotalSum + article_sum
      tx.TableCellText(TableID, CurrentRow, 4) = _
                  FormatNumber (article_sum, 2) & " US $"
      CurrentRow = CurrentRow + 1
   End If
Next

Finally, the grand total is calculated and copied to the last row in the table. The final step is to use the SaveToMemoryBuffer method to save the document in the desired format to a local buffer which isref_desc sent to the user via Response.BinaryWrite. In this case we are going to save in PDF.

' Write the contents as a PDF document to a variable and
' return it to the client
OutputBuffer = tx.SaveToMemoryBuffer(OutputBuffer, 12, 0)
Response.Clear
Response.ContentType = "application/pdf"
Response.AddHeader "Content-Disposition", "attachment; filename=order.pdf"
Response.BinaryWrite(OutputBuffer)


Delphi User's Guide

Shows you how to install and use TX Text Control with Borland Delphi.

Installing TX Text Control with Delphi

Upgrading from a Previous Version of TX Text Control

Creating a Simple Word Processor

Working with Files

Printing

Using Marked Text Fields

A Word Processor

Using Text Control with a Database

Using Images

Mail Merge

Headers and Footers

Hypertext Links

Drag and Drop

Using Multiple Controls

A Forms Filler


Installing TX Text Control with Delphi

TX Text Control must be re-imported in the Delphi development environment if

  • A prior TX Text Control has been updated.
  • The TX Text Control trial version has been replaced by the full version.

In one of these cases perform all steps described in the next section Upgrading from a Previous Version of TX Text Control.

If you import TX Text Control in Delphi for the first time, see the chapter Creating a Simple Word Processor and the next chapter New Installation with Delphi 6 and 7.

New Installation with Delphi 6 and 7

To import TX Text Control in Delphi 6 or 7, a Delphi unit is contained in the TX Text Control installation.

In the Delphi development enviroment choose Install Component from the Component menu entry. On the first tab of the opened dialog, click the first Browse... button to insert the TX Text Control unit.

Navigate to the Delphi 6-7 subfolder contained in your TX Text Control installation directory, choose the Tx4oleLib_TLB.pas file and click on Open. Confirm the settings with OK.

The dclusr.dpk package has been opened. Click on Compile to build the package. After that, close the package.

A new tab "TX Text Control" has been created in the Component Palettes containing all 4 controls of TX Text Control.


Upgrading from a Previous Version of TX Text Control

When upgrading from a previous version or from a trial version of TX Text Control, please perform the following steps to ensure a proper installation.

  • Start Delphi.
  • From the File menu, choose Open.... The Open... dialog box appears.
  • Load the package file containing the TX Text Control ActiveX component. The package files are:
  • Delphi 7: ..\Borland\Delphi7\Lib\dclusr.dpk
  • Delphi 6: ..\Borland\Delphi6\Lib\dclusr.dpk
  • Delphi 5: ..\Borland\Delphi5\Lib\dclusr50.dpk
  • Delphi 4: ..\Borland\Delphi4\Lib\dclusr40.dpk
  • Delphi 3: ..\Borland\Delphi3\Lib\dclusr30.dpk
  • After choosing one of these files, click Open.
  • The Package workspace appears.

for Delphi 4, 5, 6, 7:

  • Click the Remove button.
  • The Remove From Project dialog appears. Choose the files Tx4OleLib_TLB.dcr and Tx4OLELib_TLB.
  • Click OK to remove these files from the package.
  • Click the Compile button.
  • Click Yes to confirm that the package will be re-compiled. A message informs that the TX Text Control components are no longer registered. Confirm this with OK.
  • Delphi 4 and 5: Import the new TX Text Control version with the menu item Component - Import ActiveX Control....
  • Delphi 6 and 7: Import the new TX Text Control version as described in the chapter New Installation with Delphi 6 and 7.

for Delphi 3:

  • Choose the files Tx4OleLib_TLB.dcr and Tx4OLELib_TLB.
  • Click Remove. The files will be removed from the package. Click Compile.
  • A message informs that the TX Text Control components are no longer registered. Confirm this with OK.
  • From the File menu, choose Save.
  • Import the new TX Text Control version with the menu item Component - Import ActiveX Control....


Creating a Simple Word Processor

This chapter shows you how to create a small word processor from scratch with just a few lines of code. It will be able to load and save files, use the clipboard, and will have dialog boxes for character and paragraph formatting, a ruler, a status bar and full keyboard and mouse interface.

The source code for this example is contained in the Samples\Delphi\Simple sample source directory.

Creating the Project

Creating the Controls

Connecting the Controls

Running the Program

Setting the Page View

Resizing the Controls

Adding a Menu

What Comes Next


Creating the Project

Assuming that you have already run the Text Control installation program and started Delphi, the next step is to create a project for the text processor.To do this begin by selecting the New Application command from the file menu. If you have already imported TX into Delphi, its icons are shown when the ActiveX tab is selected. Otherwise, click on Controls / Import ActiveX... and choose the TX Text Control from the given list. Click Install and then OK until all dialogs have been closed. Now you will see the following four additional icons when the ActiveX tab is selected:

The Text Control Icon

The Status Bar Icon

The Button Bar Icon

The Ruler Icon


Creating the Controls

The next step is to put these four controls on a form and connect them. Click on the Text Control icon and draw it on the form. In the same way, create a Ruler and a Button Bar on top of the Text Control, and a Status Bar below it. Your form should now look like this:


Connecting the Controls

Add the following code to the form's FormShow event procedure:

procedure TForm1.FormShow(Sender : TObject);
begin
   TXTextControl1.ButtonBarHandle := TXButtonBar1.hWnd;
   TXTextControl1.RulerHandle := TXRuler1.hWnd;
   TXTextControl1.StatusBarHandle := TXStatusBar1.hWnd;
end;


Running the Program

The text processor is not yet finished, but we can make a first attempt at running it and seeing what it can do. Click the Start button. You can type in some text, select it with the mouse, copy it to the clipboard (use the <CTRL>+<C> and <CTRL>+<V> keys as long as there is no menu), select a different font, set tabs and do lots of other things. All of these features have been built into the Text Control and can be used with almost no programming effort.

You will have noticed, however, that some features are still missing. For instance, if you resize the main window, the controls keep their old sizes. There is no menu, and there are no scrollbars either. We will fix this in the coming chapters.


Setting the Page View

TX Text Control offers several view modes for its different tasks. To work as a word processor set the ViewMode property to Page View. This automatically adds the necessary scroll bars, page size and margins.


Resizing the Controls

Two steps are involved in making the controls resize properly when the main window is resized.

Set the Align property to alTop for the Button Bar, the Ruler and the Text Control. Set it to alBottom for the Status Bar. This will adjust everything except the height of the Text Control.

Change to the events listing in the property window and double-click the OnResize event. The code window should show an empty procedure for the Resize event:

procedure TForm1.FormResize(Sender: TObject);
begin

end;

Extend it as follows:

procedure TForm1.FormResize(Sender: TObject);
begin
   TXTextControl1.Height := ClientHeight
      - TXRuler1.Height - TXStatusBar1.Height
      - TXButtonBar1.Height;
   TXTextControl1.Width := ClientWidth;
   TXRuler1.Width := ClientWidth;
end;

This line of code will cause the Text Control's height and width to be adjusted every time the size of the form is altered.


Adding a Menu

In this chapter, you will add a menu to the text processor to enable you to call the Text Control's built-in dialog boxes.

Use the Delphi Menu Component to create a Format menu with the items Character... and Paragraph.... (Please refer to the Delphi documentation if you need help with creating menus).

Add the following code to the Click procedures of the menu items:

procedure TForm1.Character1Click(Sender: TObject);
begin
   TXTextControl1.FontDialog
end;
procedure TForm1.Paragraph1Click(Sender: TObject);
begin
   TXTextControl1.ParagraphDialog;
end;

Start the program again. You should be able to use the menu items to call the Font and Paragraph dialog boxes.

Now for the Edit menu. Again use the Menu Design Window and create an 'Edit' menu containing items for Cut, Copy and Paste. The code for these menu items is:

procedure TForm1.Cut1Click(Sender: TObject);
begin
   TXTextControl1.Clip (1);
end;
procedure TForm1.Copy1Click(Sender: TObject);
begin
   TXTextControl1.Clip (2);
end;
procedure TForm1.Paste1Click(Sender: TObject);
begin
   TXTextControl1.Clip (3);
end;

Having added these menu items, you can exchange formatted text with other word processors via the clipboard.

The last menu for now shall be a simple file menu. Create a File menu including the items Load... and Save As.... Place a common dialog box icon on the form and enter the following code, which will call the common dialog box to get a file name from the user, and will then load respectively save the selected file:

procedure TForm1.Load1Click(Sender: TObject);
const
   TXT_FIlE = 1;
   TXM_FILE = 3;
begin
   OpenDialog1.Title := 'Open file';
   OpenDialog1.Filename := '';
   OpenDialog1.Filter :=
      'Text Control Demo (*.txm)|*.txm
         |Plain text(*.txt)|*.txt';
   OpenDialog1.FilterIndex := 1;
   If OpenDialog1.Execute then begin;
   // Pass the filename to the text control
   If UpperCase(copy(OpenDialog1.Filename,
      length(OpenDialog1.filename)-2, 3)) = 'TXM' then begin
      TXTextControl1.Load(OpenDialog1.Filename, 0,
         TXM_FILE, 0);
   end
   else
      TXTextControl1.Load(OpenDialog1.Filename, 0,
         TXT_FILE, 0);
   end;
end;
procedure TForm1.Saveas1Click(Sender: TObject);
const
   TXM_FILE = 3;
begin
   SaveDialog1.Title := 'Save as ...';
   SaveDialog1.Filename := '';
   SaveDialog1.Filter := 'Text Control Demo (*.txm)|*.txm';
   SaveDialog1.FilterIndex := 1;
   SaveDialog1.DefaultExt := 'txm';
   if SaveDialog1.Execute then begin;
      // Pass the filename to the text control
      TXTextControl1.Save(SaveDialog1.Filename, 0,
         TXM_FILE, 0);
   end;
end;


What Comes Next

It goes, of course, without saying that Text Control has many more features than those included in our little demo program. It is up to you now to include zoom, images, tables, OLE objects, paragraph frames and whatever else makes up a full-blown word processor. If you need some hints about how to integrate special features, have a look at the source code of the other sample programs or post a message in the TX Text Control support forum at http://www.textcontrol.com.


Working with Files

Text Control uses 7 different file formats:

  • Its own, native format, which you would normally use to store data in document files.
  • The Rich Text Format (RTF), which can be used to exchange formatted text with other applications.
  • HTML
  • XML
  • Microsoft Word format (*.docx)
  • Microsoft Word 97-2003 format (*.doc)
  • Unformatted text in ANSI or Unicode format.
  • Adobe PDF. This file format can only be used for exporting your documents.

An example of how to use the native file format has already been presented in the previous chapter. Using RTF, HTML, Word or unformatted text is just as simple: Just specify the format you want to use as a parameter of the Load or Save method.

Using RTF, HTML, Word and unformatted text, you can only read or write the contents of a single Text Control from or to a file. Using the native file format, however, you can write a file header prior to saving the Text Control data, or even write the contents of several Text Controls to one file.

The Forms1 sample program, which is described in the section Using Multiple Controls, shows you how to write the contents of multiple Text Controls to a single file. The MDIDemo sample shows you how to write a file header prior to the Text Control's data and how to use RTF, HTML, Word and unformatted text.


Printing

Delphi provides a printer object that can be used to print the contents of a Text Control.

The following example sends the contents of a Text Control, which can be several pages long, to the default printer:

Example Code

procedure TForm1.Print1Click(Sender: TObject);
var wPages, No : Integer;
begin
   wPages := TXTextControl1.CurrentPages;
   Printer.BeginDoc;
   for No := 1 To wPages do begin
      TXTextControl1.PrintDevice := Printer.Canvas.Handle;
      TXTextControl1.PrintPage(No);
      if No <> wPages then
         Printer.NewPage;
   end;
   Printer.EndDoc;
end;

After storing the number of pages in a local variable called wPages, the printer object is initialized with the Printer.BeginDoc statement. The For .. do loop runs from 1 to wPages to print all of the pages. Inside the loop there are three lines of code which print a single page:

  • The device context handle of the printer object is assigned to Text Control's PrintDevice property. Without this step, a device context which is compatible to the screen device would be used, resulting in poor print quality.
  • The number of the page to be printed is passed as a parameter to the PrintPage method. This will also start the printing process.
  • The printer object's NewPage method is invoked to advance to the next page if there is one left.

Everything else, like calculating the line and page breaks, is done internally by Text Control. The formatting is based on the values of two groups of properties:

  • PageHeight and PageWidth determine the dimensions of the printed page.
  • PageMarginB, PageMarginL, PageMarginR and PageMarginT determine the print margins.

These properties are normally set in a page setup dialog box.


A Simple Example

This first sample program will show you how fields are created and what happens when they are clicked on. The code shown here is contained in the Samples\Delphi\Field1 sample source directory.

The program consists of a form with just one menu item, Insert Field!, with an exclamation mark to say that clicking on this item will cause an immediate action instead of dropping a menu. There are two Text Controls on the form, one of which is used as a normal text window (TXTextControl1), the other one as a pop-up window (TXTextControl2).

The following code is executed when the menu item is clicked on:

procedure TForm1.Insertfield1Click(Sender: TObject);
begin
   TXTextControl1.FieldInsert ('-------');
   TXTextControl1.FieldEditAttr[
      TXTextControl1.FieldCurrent] := $10 + $2 + $1;
end;

This inserts a field at the current caret position and sets its attributes, so it is displayed with a gray background and a second input position in front of and right behind a field.If you move the cursor over the field, Text Control changes the mouse pointer to an upward pointing arrow to indicate that there is something to click on.

If you click on the field, the application receives a FieldClicked event, to which it responds by popping up a window which displays the field number.

Only five lines of code are required for this:

procedure TForm1.TXTextControl1FieldClicked(Sender: TObject;
   FieldIndex: Smallint);
begin
   TXTextControl1.FieldCurrent := FieldIndex;
   TXTextControl2.Text := 'This is field no. '
      + InttoStr(FieldIndex) + '. Its text is: '
      + TXTextControl1.FieldText;
   TXTextControl2.Left :=
      toPixels(TXTextControl1.FieldPosX);
   TXTextControl2.Top :=
      toPixels(TXTextControl1.FieldPosY);
   TXTextControl2.BringtoFront;
end;

The first line selects the marked text field which has been clicked on. Line 2 builds the string that is to be displayed in the pop-up window. Line 3 and 4 moves the pop-up window, which is initially hidden behind the text window, to the position of the marked text field. Line 5 puts the pop-up window in front of the text window to make it visible. When the mouse button is released, the text window is moved to the front again:

procedure TForm1.TXTextControl1MouseUp(Sender: TObject;
   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
   TXTextControl1.BringtoFront;
end;


Bookmarks

This example shows you how to use Text Control's marked text fields to create bookmarks. The first version will reference the bookmarks simply by their field numbers. The source code for this example is contained in the Samples\Delphi\Field2 sample source directory.

The sample application has a Bookmark menu with two items which are named Insert and Go to.... Clicking Insert creates a marked text field at the current caret position. If a text selection exists, the selected text is converted into a field. If not, the character next to the caret is selected.

procedure TForm1.Insert1Click(Sender: TObject);
var
   fieldID : Integer;
begin
   If TXTextControl1.Text = '' Then
      Application.MessageBox ('Cannot insert a bookmark
         if the Text Control is empty.','ERROR',MB_OK)
   Else begin
      If TXTextControl1.SelLength = 0 Then
         TXTextControl1.SelLength := 1;
      TXTextControl1.FieldInsert ('');
      fieldID := TXTextControl1.FieldCurrent;
      TXTextControl1.FieldEditAttr[fieldID] :=
            $10 + $2 + $1;
   end;
end;

After typing in some text and inserting a few bookmarks, select the Go To... menu item. This will launch a dialog box which allows you to enter the number of the bookmark to jump to. There is no error processing in this example, so if you enter the number of a non-existent field, nothing will happen.

Clicking the OK button executes the following procedure:

procedure TfrmGoto.Button1Click(Sender: TObject);
begin
   Form1.TXTextControl1.FieldCurrent :=
      StrtoInt(Edit1.Text);
   Form1.TXTextControl1.SelStart :=
      Form1.TXTextControl1.FieldStart - 1;
   Form1.TXTextControl1.SelLength :=
      Form1.TXTextControl1.FieldEnd
         - Form1.TXTextControl1.FieldStart + 1;
   Close;
end;

The number which has been entered in the dialog box is taken as a value for the FieldCurrent property.


Adding Strings to Marked Text Fields

The source code for this example is contained in the Samples\Delphi\Field3 sample source directory.

In commercial word processors, bookmarks are normally referenced by names, not just by numbers. The names are typed in by the user when he creates a bookmark. The Goto Bookmark dialog box then presents a listbox or combobox in which one of the strings can be selected.

The Insert Bookmark... menu item in this version of the program creates a dialog box where the user can enter a label for the bookmark.

When the OK button is clicked, the following code is executed:

procedure TfrmInsert.btnOKClick(Sender: TObject);var fieldID : Integer;
begin
   If Form1.TXTextControl1.SelLength = 0 Then begin
      If Form1.TXTextControl1.SelStart
         = Length(Form1.TXTextControl1.Text) Then
      begin
         Form1.TXTextControl1.SelText := ' ';
         Form1.TXTextControl1.SelStart :=
            Form1.TXTextControl1.SelStart - 1;
      end;
      Form1.TXTextControl1.SelLength := 1;
   end;
   // Insert a field and store the bookmark name in its
   // FieldData property
   Form1.TXTextControl1.FieldInsert ('');
   fieldID := Form1.TXTextControl1.FieldCurrent;
   Form1.TXTextControl1.FieldEditAttr [fieldID] :=
         $10 + $2 + $1;
   Form1.TXTextControl1.FieldData
      [Form1.TXTextControl1.FieldCurrent] := Edit1.Text;
   Form1.TXTextControl1.SelLength := 0;
   Close;
end;

First, a marked text field is created at the current caret position. Second, the name of the bookmark, which is the text that has been typed in by the user, is stored in the FieldData property.

The Goto Bookmark dialog box contains a combo box which lists all of the bookmarks which have been created so far.

The combo box is filled with the bookmark titles when its form is loaded:

procedure TfrmGoto.FormShow(Sender: TObject);
var
   nfieldID : Integer;
begin
   nFieldID := 0;
   cboBookmark.Clear;
   // Fill the combobox with bookmarks
   Repeat
      nFieldID := Form1.TXTextControl1.FieldNext(
            nfieldID, 0);
      If nFieldID > 0 Then
         cboBookmark.Items.Add(
            Form1.TXTextControl1.FieldData[nFieldID])
   Until nFieldID = 0;
   // Copy first item to the edit control part of the
   // combo box
   cboBookmark.Text := cboBookmark.Items.Strings[0];
end;

When the OK button is clicked, the bookmark list is searched for the string which has been selected in the combo box, and the corresponding marked text field is selected.

procedure TfrmGoto.Button1Click(Sender: TObject);
var
   nFieldID : Integer;
label
   Exit;
begin
   nFieldID := 0;
   // Search for the requested bookmark
   Repeat
      nFieldID := Form1.TXTextControl1.FieldNext(
            nFieldID, 0);
      If nFieldID > 0 Then begin
         If Form1.TXTextControl1.FieldData[nFieldID] =
            (cboBookmark.Text) Then
         begin
            Goto Exit;
         end;
      end;
   until nFieldID = 0;
   Exit:
   // If the bookmark has been found, select it.
   // Text Control will then automatically scroll
   // to make it visible
   If nFieldID <> 0 Then begin
      Form1.TXTextControl1.FieldCurrent := nFieldID;
      Form1.TXTextControl1.SelStart :=
         Form1.TXTextControl1.FieldStart - 1;
      Form1.TXTextControl1.SelLength :=
         Form1.TXTextControl1.FieldEnd
         - Form1.TXTextControl1.FieldStart + 1;
      end
   Else
      Application.MessageBox(
         'Bookmark not found.','ERROR',MB_OK);
   Close;
end;

You can also extend the sample program with a dialog box, similar to the Go To Bookmark... dialog, in which a bookmark can be deleted without deleting the text. This would require converting the Marked Text Field to normal text. Use the FieldDelete method to achieve this.

More information about marked text fields and a list of all properties, methods and events that can be used with marked text fields, can be found in the chapter Technical Articles - Marked Text Fields.


A Word Processor

This chapter shows you how to use Text Control to write a standard word processor.

The source code for this example is contained in the Samples\Delphi\MDIDemo sample source directory.

Adding a PageSetup Dialog Box

A Print Dialog Box

Search and Replace

Using Paragraph Frames

Dialog Boxes for Text and Background Color


Adding a PageSetup Dialog Box

The Page Setup dialog box is used to determine the page size and print margins. The maximum page size is restricted by the capabilities of the default printer. For implementation details, look at the source code of the frmPageDlg form.


Dialog Boxes for Text and Background Color

This is also done with Common Dialogs. The color value returned from the dialog box is assigned to the BackColor property.


Using Text Control with a Database

This chapter describes how to use Text Control to access databases with the Delphi TDBNavigator control. If you are not familiar with the TDBNavigator control please refer to the Delphi documentation.

The source code for this example is contained in the Samples\Delphi\Database sample source directory.

The Sample Program

The sample uses the LoadFromMemory and SaveToMemory methods to store data to the database and vice versa. Not only is the plain text stored, but also all formatting information, e.g. font and paragraph attributes, colors and image file names. The data is stored in RTF format, which is easiest to handle.

The Database sample program is connected to a small data base which contains descriptions of some of Text Control's properties. You can browse through the records of the data base by clicking the TDBNavigator control buttons on the lower left side of the window. If you want to change something in the current record, press the button with the triangle.


Using Images

TX Text Control provides three different methods for inserting images:

  • The ImageInsert method is the default method for inserting images. An image inserted with this method will be anchored to a paragraph. Text can flow around the image, and the image will move with the paragraph.
  • Images inserted with the ImageInsertAsChar method are handled like a single character in the text. This method is often used for inserting small images and icons.
  • The ImageInsertFixed method inserts an image at a fixed position on the page. The image will keep its position regardless of the surrounding text.

Images can be inserted from a file or from the clipboard. When saving a document, you can select whether to embed image data in the document file, or save a reference to a seperate image file. Note that not all options are available in all file formats. For instance, while image data can be embedded in .RTF, .DOCX and .DOC files, HTML does not provide this option.

Further options are:

  • to convert images to a different file format,
  • to convert embedded images to image files, and
  • to change image resolution and compression rate.

This is especially useful, if you create HTML files, where embedded images and image file formats like WMF or TIFF need to be converted to JPEG or GIF files for display in a browser. Image resolution and compression settings are also required for creating PDF files, for instance to create one version of a PDF with low-resolution images for viewing on screen, and another one with high resolution images for printing.

An overview of all properties, methods and events which can be used in conjunction with images can be found at Images, Text Frames and OLE Objects. Properties which have a name that begins with "Object" can be used with images as well as other kinds of embedded objects, like text frames and OLE objects, whereas those starting with "Image" only apply to images.

Inserting an Image

Setting Image Attributes


Inserting an Image

The source code for this sample program is contained in the Samples\delphi\Images sample source directory.

The TForm1.Insert1Click function shows you how to open a dialog box for selecting an image file, and then insert the image:

[Delphi]
procedure TForm1.Insert1Click(Sender: TObject);
begin
    OpenDialog1.Title := 'Insert Image';
    OpenDialog1.Filename := '';
    OpenDialog1.Filter := TXTextControl1.ImageFilters;
    OpenDialog1.FilterIndex := 1;
    OpenDialog1.Options := [ofPathMustExist, ofFileMustExist, ofHideReadOnly];

    if OpenDialog1.Execute then begin
        try
            TXTextControl1.ImageInsert(OpenDialog1.Filename,-1, 1, 0, 0, 100, 100, 3, 0, 0, 0, 0);
        except
            MessageDlg('Cannot insert image: ' + OpenDialog1.filename + '.', mtError, [mbOK], 0);
        end;
    end;
end;

The image is inserted using the ImageInsert method.


Setting Image Attributes

TX Text Control has a built-in dialog box which enables you to change the size of an image, the way images are stored, and various other settings. In the sample program, the Image Attributes dialog box is invoked either with the Image Settings menu item, or by right-clicking on an image. The dialog box is opened using the ObjectAttrDialog method:

[Delphi]
procedure TForm1.Settings1Click(Sender: TObject);
begin
    TXTextControl1.ObjectAttrDialog;
end;

procedure TForm1.TXTextControl1ObjectRightClicked(Sender: TObject;
    ObjectId: Smallint);
begin
    TXTextControl1.ObjectAttrDialog;
end;


Mail Merge

The chapter Using Text Control with a Database showed you how to store a Text Control's entire contents in a database field. For implementing functions like mail merge, however, the requirements are different: the contents of database fields have to be inserted at specified positions in a previously prepared document. The following sample program provides you with the basis of how to this.

The code shown here is contained in the Samples\Delphi\StdLet sample source directory.

The Sample Program

How it Works


The Sample Program

The program consists of two forms, Form1 for creating a text and Form2 for connecting it to the database.

Start the program and use the File / Open... command to load the sample file account.tx. The file contains three fields which are to be replaced by database entries. Select Insert / Data to access Form2. When you click the Insert button in Form2, the contents of the three database fields are copied to the text fields in Form1. You can select a different record by clicking one of the data control buttons in Form2, and then clicking Insert again to replace the fields.


How it Works

Each of the 3 edit controls on the second form is connected to a field in the database. The data is read from the database in the same way as in the Database sample.The only new thing is copying the data from the edit controls to the text fields in the document. This is done when you click on the Insert button:

procedure TForm2.Button1Click(Sender: TObject);
begin
   Form1.TXTextControl1.FieldCurrent := 1;
   Form1.TXTextControl1.FieldText := Form2.Edit1.Text;
   Form1.TXTextControl1.FieldCurrent := 2;
   Form1.TXTextControl1.FieldText := Form2.Edit2.Text;
   Form1.TXTextControl1.FieldCurrent := 3;
   Form1.TXTextControl1.FieldText := Form2.Edit3.Text;
end;

To implement a real mail merge function you will have to add a dialog box in which the user can select the database to be used. You may also want to provide a variable number of database fields which are dependent on the contents of the selected database.


Headers and Footers

This example shows how to use headers and footers. The source code is contained in the Samples\Delphi\Headers sample source directory.

TX supports headers as well as footers. You also have the ability to create a different header or footer for the first page.

The Sample Program

To insert a header or footer in the example, click on Insert and choose one of the four possible options. The code that is executed when clicking on one of the menu items is almost the same. For the Header menu item it looks as shown below. The line

TXTextControl1.HeaderFooter := TXTextControl1.HeaderFooter + txHeader;

informs Text Control that a header should be added to the current settings.

Setting the HeaderFooterStyle property to txMouseClick enables the user to activate the header with a single click rather than a double-click. Activating a header or footer with a double-click is Text Control's default setting. More information about how to use headers and footers and a list of all properties, methods and events that can be used with headers and footers, can be found in the chapter Technical Articles - Headers and Footers.

When using properties, Text Control distinguishes between the main text and headers or footers. To switch between these different independent text parts, Text Control provides the HeaderFooterSelect method:

TXTextControl1.HeaderFooterSelect (txHeader);
TXTextControl1.SelText := 'Header';
TXTextControl1.HeaderFooterSelect (0);

This code selects the header, so that the following code affects the header and then sets the headers text. Finally the mode is reset to zero using the HeaderFooterSelect method. More information about programming with headers and footers see the chapter Technical Articles - Headers and Footers - Programming Headers and Footers.

A header or footer is activated from programming code using the HeaderFooterActivate method. To delete a header or footer, simply substract the txHeader constant from the current HeaderFooter settings. The following is the complete code of the menu item:

procedure TForm1.Header1Click(Sender: TObject);
begin
   If Header1.Checked = False Then begin
      TXTextControl1.HeaderFooter
         := TXTextControl1.HeaderFooter + txHeader;
      TXTextControl1.HeaderFooterSelect (txHeader);
      TXTextControl1.SelText := 'Header';
      TXTextControl1.HeaderFooterSelect(0);
      TXTextControl1.HeaderFooterActivate (txHeader);
      Header1.Checked := True;
   end Else begin
      TXTextControl1.HeaderFooter
         := TXTextControl1.HeaderFooter - txHeader;
      Header1.Checked := False;
   End;
end;


Hypertext Links

This chapter shows how to use Text Control's marked text fields to insert hypertext links and targets into text documents and how to respond to events which Text Control fires when the user clicks on a hypertext link.

The source code for the following examples is contained in the sub folders Step1 to Step4 of the Samples\Delphi\HyperLnk sample source directory.

Step 1 - Inserting a Hypertext Link

Step 2 - Adding a Dialog Box for Inserting Hypertext Links

Step 3 - Adding Targets

Step 4 - Adding Jumps to External Targets


Step 1 - Inserting a Hypertext Link

In this first sample program a hypertext link will be inserted in a text document. The document is saved then as a HTML file so that it can be viewed in a browser.

Hypertext links are handled as a special type of a marked text field. A hypertext link therefore is inserted by calling the FieldInsert method, and then specifying the type of the field with the FieldType property:

TXTextControl1.FieldInsert ('Text Control Web Site');
TXTextControl1.FieldType[TXTextControl1.FieldCurrent]
   := txFieldExternalLink;

To store the target to where the link points, the FieldTypeData property is used:

TXTextControl1.FieldTypeData[TXTextControl1.FieldCurrent] :=
   'http://www.textcontrol.com';

The following line of code saves the document, containing the hypertext link, which has just been inserted as a HTML file in the sample folder:

TXTextControl1.Save (Application.GetNamePath + '.html',
   0, 4, False);

When this file is loaded with a web browser, the hypertext link will be displayed as specified in your browser's settings. Clicking on the link, will take you to the Text Control web site.

Note that there is no code for the Click events yet, so clicking on the hypertext link in the Text Control will have no effect. Also, the link is neither underlined nor colored.


Step 2 - Adding a Dialog Box for Inserting Hypertext Links

In this second sample program a dialog box is created which enables the user to insert hypertext links in a more convenient way. Additionally, hypertext links which have previously been inserted or loaded from a file, can be edited and modified. Note that, while hypertext links are usually associated with HTML files, they can as well be stored in RTF or Microsoft Word files, or in Text Control's proprietary format.

The dialog box has two text boxes. The first is for the text that represents the hypertext link in the document and the second is for the address, to where the link points. In the step 1 example, the representing text was "Text Control Web Site", and the address, to where the link points, was "http://www.textcontrol.com".

The same dialog box is used for both, inserting a new and editing an existing hypertext link. Depending on whether the current input position is inside of an existing link, this link is modified. Otherwise a new one is inserted.

The dialog form's property, tx is used to pass a Text Control's reference to the form.

procedure TForm1.HypertextLink2Click(Sender: TObject);
begin
   Form2.tx := TXTextControl1;
   Form2.ShowModal;
end;

When the form is loaded, the text boxes are filled with the text and link information when the current input position is inside of an existing link:

procedure TForm2.FormShow(Sender: TObject);
begin
   // If the caret is inside an existing hyperlink,
   // copy the hyperlink's text and link information
   // to the text boxes on the form.
   If (Form1.TXTextControl1.FieldAtInputPos <> 0) Then  begin
      txtLinkedText.Text := Form1.TXTextControl1.FieldText;
      txtLinkTarget.Text :=
         Form1.TXTextControl1.FieldTypeData[
            Form1.TXTextControl1.FieldCurrent];
   end Else begin
      txtLinkedText.Text := Form1.TXTextControl1.SelText;
      txtLinkTarget.Text := '';
   end;
end;

The user then can change the displayed information. The information is then transfered to the document by either inserting a link or modifying the existing one when the OK button is pressed:

If tx.FieldAtInputPos <> 0 Then begin
   // editing an existing hyperlink
   tx.FieldText := txtLinkedText.Text;
   tx.FieldType[tx.FieldCurrent] := txFieldExternalLink;
   tx.FieldTypeData[tx.FieldCurrent] := txtLinkTarget.Text;
end Else begin
   // insert new hyperlink
   tx.FieldInsert (txtLinkedText.Text);
   tx.FieldType[tx.FieldCurrent] := txFieldExternalLink;
   tx.FieldTypeData[tx.FieldCurrent] := txtLinkTarget.Text;
   HighlightHyperlinks (tx, Form1.HypertextLinks1.Checked);
End;

Finally, there is a menu item to switch the character format of the hyperlink's text to blue colored and underlined style. The menu item calls the function HighlightHyperlinks, which is defined in the file Unit3.pas.


Step 3 - Adding Targets

Step 1 and 2 only handle references to external resources, i.e. addresses of web pages or files. In this step, links to positions in the same document will be handled. These links are called internal links and the positions, to where they point, are called targets. Targets are also referred to as anchors (in the context of HTML editors) or bookmarks (in word processors). When using this example, first add some text and then some targets with the Insert / Target... menu item. Finally use the Insert / Hypertext Link... menu item to add links to these targets.

1. Inserting a Target:

Targets are realized again as a special type of a marked text field. The type and the target's name must be set with the FieldType and the FieldTypeData properties.

Unlike links, targets have no visible text, therefore an empty field must be inserted with the FieldInsert method to insert a target:

procedure TForm1.Target1Click(Sender: TObject);
var
   TargetName : String;
begin
   TargetName := InputBox('Target name:',
         'Insert target', '');
   If TargetName <> '' Then begin
      TXTextControl1.FieldInsert ('');
      TXTextControl1.FieldType[TXTextControl1.FieldCurrent]
            := txFieldLinkTarget;
      TXTextControl1.FieldTypeData[
            TXTextControl1.FieldCurrent]
               := TargetName;
   End;
end;

Only one text box is required to display the name of a target, so a simple InputBox statement can be used.

2. Inserting Links to Targets:

To insert links to the just inserted targets, the Hypertext Link dialog box is extended with a list box showing the names of all targets the document contains. The FieldNext method is used to fill this list box:

Procedure TForm2.FillListboxWithTargets(Sender : TObject);
var
   FieldID : Integer;
begin
   ListBox1.clear;
   FieldID := tx.FieldNext(0, $100);
   While FieldID <> 0 do begin
      ListBox1.Items.Add(tx.FieldTypeData[FieldID]);
      FieldID := tx.FieldNext(FieldID, $100);
   end;
end;

When the user selects a target, the Link To field is filled with the target's name.

After typing the link's text and pressing the OK button, the link is inserted. An internal link is inserted in the same way as the external links from step 1, but the FieldType property now is set to txFieldInternalLink and the FieldTypeData property is set to the target's name.

3. Jumping to a Target:

After inserting internal links and targets, a jump must be realized. When the user clicks on a marked text field that represents a hypertext link, Text Control fires a FieldLinkClicked event. The information provided through this event can be used with the FieldGoto method to jump to the target:

procedure TForm1.TXTextControl1FieldLinkClicked(Sender: TObject; FieldId,
   FieldType: Smallint; var TypeData: WideString);
begin
   If FieldType = txFieldInternalLink Then
      TXTextControl1.FieldGoto(txFieldLinkTarget, TypeData);
end;

While the FieldGoto method is used for targets within the same file, links to external targets must be treated differently. When the Jumping to an External Target event occurs, and the FieldType parameter indicates that the link is external, then it depends on the type of the application, what to do. External links can point to, for instance, files on the local harddisk, or addresses in the internet.

Note that responding to the events is only required for making the hypertext links work while the text is edited in Text Control. If the text is saved to a file and displayed with a browser, then the hypertext links will work depending on the used browser.


Step 4 - Adding Jumps to External Targets

Finally, in this step, jumps to other documents and jumps to targets in these documents are added.

1. An Enhanced Dialog Box for Displaying and Selecting Targets:

Again the Hypertext Link dialog box is extended to choose an external file. A Choose File... button is placed on the form that triggers a common dialog.

After the user has chosen a file, its name is displayed in the text box and the file is searched for internal targets:

procedure TForm2.CheckFileForTargets(tfile : String);
begin
   txhidden.LoadSaveAttribute[txEnableLinks] := True;
   txhidden.Load (tfile, 0, 4, false);
   FillListboxWithTargets (1);
   RadioButton2.Checked := True;
   loadedFile := tfile;
End;

For this purpose the file is loaded in a second, invisible Text Control. Then the FieldNext method is used as in step 3 to list all targets.

2. Jumping to an External Target:

To implement the jump to an external link, the code added to the FieldLinkClicked event in step 3 must be extended. The following code does not handle jumps to internet addresses, it only implements jumps to targets in other files. To separate a file from a name of a target, Text Control uses the '#' character. The following code separates the file name and the target's name, loads the file with the Load method and jumps to the target with the FieldGoto method:

Else begin
   // determine which type of link we have
   // (see List1_Click()) and remove
   // the '#' character.
   If (copy(txtLinkTarget.Text, 0, 1) = '#') Then begin
      LinkType := txFieldInternalLink;
      txtLinkTarget.Text := copy(txtLinkTarget.Text, 1,
         Length(txtLinkTarget.Text) - 1);
   end Else
      LinkType := txFieldExternalLink;
   If tx.FieldAtInputPos <> 0 Then begin
      // editing an existing hyperlink
      tx.FieldText := txtLinkedText.Text;
      tx.FieldType[tx.FieldCurrent] := LinkType;
      tx.FieldTypeData[tx.FieldCurrent] :=
            txtLinkTarget.Text;
   end Else begin
      // insert new hyperlink
      tx.FieldInsert (txtLinkedText.Text);
      tx.FieldType[tx.FieldCurrent] := LinkType;
      tx.FieldTypeData[tx.FieldCurrent] :=
            txtLinkTarget.Text;
   End;
   HighlightHyperlinks (tx, Form1.HypertextLinks1.Checked);
   close;
End;

3. Loading and Saving Files containing Hypertext Links:

When an HTML, RTF or Microsoft Word document is loaded, Text Control must convert containing hypertext links to appropriate marked text fields as described above. To perform this, a programmer must set the LoadSaveAttribute (txEnableLinks) before using the Load method. Otherwise hypertext links and target fields are not converted. When a document is saved, marked text fields that represent hypertext links, are always converted to the appropriate format.

If Text Control's proprietary format is used, setting LoadSaveAttribute is not necessary.

More information about hypertext links and a list of all properties, methods and events that can be used with marked text fields, can be found in the chapter Technical Articles - Marked Text Fields - Special Types of Marked Text Fields.


Drag and Drop

This example shows how to use the InputPosFromPoint method to realise a simple Drag&Drop in a Text Control application.

Drag&Drop in a text editor enables the user to drag a piece of text and drop it in a new location of the document. So, the incoming mouse events have to be analyzed and handled.

The Sample Program

In the InputPosFromPoint method is used to get the character position the user has clicked on. The current input position and the length of the selection are stored in global variables, because they are needed in the MouseUp event. If the input position the user has clicked on, is inside of the current selection, dragging can be started. First a global variable named dragging is set to true and the MousePointer property is changed to indicate that dragging is in process. The text and format information of the current selection is copied to a memory buffer using the SaveToMemory method. Finally, the Text Control's EditMode property is set to 2 - read only.

procedure TForm1.TXTextControl1MouseDown(Sender: TObject;
   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
   pos : LongInt;
begin
   //Get current input position and the current selection
   pos := TXTextControl1.InputPosFromPoint(toTwips(X),
            toTwips(Y));
   gblStart := TXTextControl1.SelStart;
   gblLength := TXTextControl1.SelLength;
   //Check if the click occured in the current selection
   If (gblStart <= pos) And (gblStart + gblLength > pos)
         Then begin
      //Start dragging
      data := TXTextControl1.SaveToMemory(3, True);
      dragging := true;
      Cursor := 2;
      TXTextControl1.EditMode := 2;
   End;
end;

In the MouseUp event procedure the InputPosFromPoint method is used again to get the character position where the user has left the mouse button. When dragging is in process and the input position is not inside the current selection, the drop operation can be performed. The previously saved text now is inserted with the LoadFromMemory method after setting the new input position with the SelStart property.

procedure TForm1.TXTextControl1MouseUp(Sender: TObject;
   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
   pos : LongInt;
begin
   pos := TXTextControl1.InputPosFromPoint(toTwips(X),
            toTwips(Y));
   If dragging Then begin
      //Check if the new input position is outside of
      //the current selection. If it's not, do not
      //copy the text
      If Not ((gblStart <= pos)
            And (gblStart + gblLength > pos)) Then begin
         TXTextControl1.SelText := '';
         If pos < gblStart Then
            TXTextControl1.SelStart := pos
         Else
            TXTextControl1.SelStart := pos - gblLength;
         TXTextControl1.LoadFromMemory(data, 3, True);
      End;
      //End dragging
      dragging := False;
      Cursor := 0;
      TXTextControl1.EditMode := 0;
   End;
end;


Using Multiple Controls

This chapter shows how to use Text Control in programs which have several text fields placed on a single page. Think of a program to print labels, to fill out forms, or to mask data entry. The Forms1 sample program, which can be found in the Samples\Delphi\Forms1 subdirectory provides the basic functionality for applications of this kind.

Running the Sample Program

How it Works

Saving the Controls

Printing Multiple Controls


Running the Sample Program

Initially, when the program is started, the main window contains one framed Text Control where text can be entered. The rest of the window is empty.

What you can do with the program is:

  • Move the Text Control by pressing the ALT key and dragging the window with the mouse.
  • Resize the Text Control by pressing the ALT key and dragging the window borders with the mouse.
  • Create additional controls by clicking on an empty part of the main window.
  • Save, load or print.

To keep things simple, there are no scrollbars in the main window and no menu items except the ones listed above. Scrollbars, zoom and a few other features will however be added in the next section.


How it Works

The Forms1 sample uses a control array for the text fields. The first Text Control, the one which you see when you start the program, is placed on the form at design time. More controls are created when you click on an empty area of the form. These controls are created dynamically with the Delphi Create method. Then they are assigned initial values.

procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
   Shift: TShiftState; X, Y: Integer);
begin
   MaxID := MaxID + 1;
   TX := TTXTextControl.Create(Form1);
   TX.Parent := Form1;
   TX.Top := Y;
   TX.Left := X;
   TX.Width := TXTextControl1.Width;
   TX.Height := TXTextControl1.Height;
   TX.Name := 'TXTextControl' + InttoStr(MaxID);
   TX.SizeMode := 3; // Move- and sizeable
   TX.BringtoFront;
   TX.OnMouseDown := TXTextControl1MouseDown;
end;

Clicking on an existing text field brings it to the front. This is done by changing the Z order when a Click event has occurred:

procedure TForm1.TXTextControl1MouseDown(Sender: TObject;
   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
   TTXTextControl(Sender).BringtoFront;
end;

The global variable MaxID counts the total number of controls; It is initialized to a value of 1 when the form is loaded.

Moving and resizing the controls is done by Text Control itself. To enable these functions, the SizeMode property must be set to 3 - Move and Sizeable.


Saving the Controls

Saving a document which has been created with this program necessitates storing not only the data contained in the Text Controls, but also the number and the positions of the controls. In addition, a format identifier should be stored to enable the load routine of the program to determine if it can process a file which it is about to load. The code on the following page shows you how to save the document.

procedure TForm1.Save1Click(Sender: TObject);
var
   outFile : file of byte;
begin
   // Create an "Open File" dialog box
   SaveDialog1.Title := 'Save as';
   SaveDialog1.Filename := '';
   SaveDialog1.DefaultExt := 'txm';
   SaveDialog1.Filter := 'TX Form Demo (*.txf)|*.txf';
   SaveDialog1.FilterIndex := 1;
   if SaveDialog1.Execute then
      Filename := SaveDialog1.Filename
   else
      Exit;
   try
      begin
      // Open the selected file
      AssignFile(outFile, filename);
      rewrite(outFile);
      // Write file header
      FileID.lVersion := File_ID;
      BlockWrite(outFile, FileID, sizeOf(FileID));
      //Save properties of all text controls
      BlockWrite(outFile, MaxID, sizeof(MaxID));
      For i := 1 To MaxID do begin
         TXhWnd := FindComponent('TXTextControl'
               + Inttostr(i));
         with TXProp do begin
            xPos := TTXTextControl(TXhWnd).Left;
            yPos := TTXTextControl(TXhWnd).Top;
            xSize := TTXTextControl(TXhWnd).Width;
            ySize := TTXTextControl(TXhWnd).Height;
         end;
         BlockWrite(outFile, TXProp, sizeof(TXProp));
      end;
      closeFile(outFile);
      //Save contents of all text controls
      For i := 1 to MaxID do begin
         TXhWnd := FindComponent('TXTextControl'
               + InttoStr(i));
         TTXTextControl(TXhWnd).Save(FileName, -1,
               3, False);
      end;
   end;
   Except
      MessageDlg('Error saving ' + filename, mtError,
            [mbOK], 0);
   end;
end;

The Load routine first reads the format ID and the number of controls. Then it creates the required number of controls, loads their contents and finally moves them to their correct position:

procedure TForm1.Load1Click(Sender: TObject);
var
   lFilePos : LongInt;
   InpFile  : file of byte;
   bOpen : Boolean;
begin
   // Create an "Open File" dialog box
   OpenFileDialog.Title := 'Open file';
   OpenFileDialog.Filename := '';
   OpenFileDialog.Filter := 'TX Form Demo (*.txf)|*.txf';
   OpenFileDialog.FilterIndex := 1;
   if OpenFileDialog.Execute then
      Filename := OpenFileDialog.Filename
   else Exit;
   try
      begin
         // Open the selected file
         bOpen := False;
         AssignFile(inpFile, filename);
         reset(inpFile);
         bOpen := True;
         // Read file header
         BlockRead(inpFile, FileID, sizeOf(FileID));
         If FileID.lVersion <> FILE_ID Then begin
            MessageDlg('Wrong filetype: ' + filename,
               mtError,[mbOK],0);
            Exit;
         End;
         // Destroy existing controls
         If MaxID > 1 then begin
            For i := 2 To MaxID do begin
               TXhWnd := FindComponent('TXTextControl'
                  + Inttostr(i));
               TTXTextControl(TXhWnd).Free;
            end;
         end;
         //Create text controls and load their contents
         BlockRead(InpFile, MaxID, sizeof(MaxID));
         For i := 1 To MaxID do begin
            BlockRead(InpFile, TXProp, sizeof(TXProp));
            If i <> 1 Then begin
               TX := TTXTextControl.Create(Form1);
               TX.Parent := Form1;
               TX.Width := TXTextControl1.Width;
               TX.Height := TXTextControl1.Height;
               TX.Name := 'TXTextControl'
                  + InttoStr(i);
               TX.SizeMode := 3;
               TX.BringtoFront;
               TX.OnMouseDown := TXTextControl1MouseDown;
            end;
            TXhWnd := FindComponent('TXTextControl'
               + Inttostr(i));
            TTXTextControl(TXhWnd).Left := TXProp.xPos;
            TTXTextControl(TXhWnd).Top := TXProp.yPos;
            TTXTextControl(TXhWnd).Width := TXProp.xSize;
            TTXTextControl(TXhWnd).Height := TXProp.ySize;
            TTXTextControl(TXhWnd).Text := '';
         end;
         lFilePos := FilePos(InpFile);
         closeFile(InpFile);
         bOpen := False;
         For i := 1 To MaxID do begin
            TXhWnd := FindComponent('TXTextControl'
               + Inttostr(i));
            lFilePos := TTXTextControl(TXhWnd).Load(
               FileName, lFilePos, 3, False);
            TTXTextControl(TXhWnd).Visible := True;
         end;
      end;
   Except
      MessageDlg('Error opening ' + filename, mtError,
            [mbOK], 0);
      if bOpen then begin
         closeFile(inpFile);
      end;
   end;
end;


Printing Multiple Controls

Printing a document is quite straightforward. The ViewMode property is set to 4 - Simple Control, so the controls are printed like they are formatted on the screen. The PageMargin properties are used to specify the positions of the controls on the page.

procedure TForm1.Print1Click(Sender: TObject);
begin
   Printer.BeginDoc;
   For i := 1 To MaxID do begin
      TXhWnd := FindComponent('TXTextControl' +
            InttoStr(i));
      TTXTextControl(TXhWnd).PrintDevice := Printer.Handle;
      TTXTextControl(TXhWnd).PageMarginL :=
            toTwip(TTXTextControl(TXhWnd).Left);
      TTXTextControl(TXhWnd).PageMarginT :=
            toTwip(TTXTextControl(TXhWnd).Top);
      TTXTextControl(TXhWnd).PrintPage (1);
   end;
   Printer.NewPage;
   Printer.EndDoc;
end;

The complete source code of the Forms1 sample program is contained in the Samples\Delphi\Forms1 sample source directory.


A Forms Filler

The Sample Program

Adding a Button Bar, a Ruler Bar and a Status Bar

Displaying the Background Image

Working with Transparent Text Controls

Zooming


The Sample Program

With the Forms1 sample program, you can place text fields at arbitrary positions on a page. When you print the page, the text fields appear on the paper at exactly the same positions where they were previously placed on the screen. These features will be used in the following sample to create a program for filling out pre-printed forms.

The scanned image of the form is shown in the background of the screen, enabling the user to easily determine the positions of the filled-out fields. He has only to click (with the CTRL key pressed) on the area of the form where he wants to put text and then start typing. The fields can be moved and resized afterwards by holding down the ALT key and dragging them with the mouse.

The source code for this example is contained in the Samples\Delphi\Forms2 sample source directory.


Adding a Button Bar, a Ruler Bar and a Status Bar

The Button Bar, Ruler and Status Bar are used in a special way in this sample program. If you run the program and click on various fields you will notice that the tools automatically switch to the text field which has been clicked on. This switching is done internally by Text Control, so no programming is required for it. Each control is simply connected to the status bar, etc. when it's created.


Displaying the Background Image

The background image is displayed by an Image Control. This is not a separate custom control, but a child window of the Text Control. To display the background image, create a Text Control which has the size of the whole page, and then load an image using Text Control's ObjectInsertAsChar method.

The Text Control which displays the background image has an additional function, which again saves a lot of programming work. It acts as a container for the Text Controls which are used as fill-out fields. (A container control enables you to draw other controls within it at design time). The big advantage of a container is that it handles all of the clipping for the controls which have been created on top of it. Otherwise, scrolling the background image would cause the text fields to overwrite anything that lies within the form's boundaries, like ButtonBar, Ruler, and even the scrollbars. It would require many calculations of field positions and sizes and some direct calls to the Windows DLLs on every scroll and resize event to do the clipping without a container control. Using the background Text Control as a container, you need only create the first text field inside of it, and everything else is done automatically.


Working with Transparent Text Controls

Run the program, load a background image and create a few text fields by clicking on this background image. You will notice that the text fields are transparent, so you can see the background image below. Using this feature in a program requires some fine-tuning of the clipping areas with the ClipChildren and ClipSiblings properties.

These two properties determine which areas of an image are repainted when a new part of a control becomes visible or when its contents have been changed. For example, if one control is covered by another, it only has to be repainted if the one which lies on top of it is transparent. You will always want to repaint as little as possible to make the application run fast and to avoid unnecessary flickering on the screen. Furthermore you will not want your computer to spend time drawing things which are not visible.

For maximum flexibility in setting the clipping areas and mixing transparent and opaque controls, two properties have been implemented which share this task:

The ClipChildren property is used only for Text Controls which act as a container for other Text Controls. When ClipChildren is set to True, the areas occupied by the child controls are excluded from the update area. So, if as in the forms filler program, transparent controls are used as children of the container control, this property must be set to False.

The ClipSiblings property determines the behaviour between each of the child controls. It must be set to False if the program allows transparent Text Controls to overlap others.


Zooming

Zooming is simply done by setting the ZoomFactor property of each of the Text Controls:

procedure TForm1.N751Click(Sender: TObject);
begin
   Zoom := TXParent.ZoomFactor;
   TXParent.ZoomFactor := 75;
   For i := 1 to MaxID do begin
      TXhWnd := FindComponent('TXChild' + InttoStr(i));
      TTXTextControl(TXhWnd).ZoomFactor := 75;
   end;
   TXhWnd := FindComponent('N' + InttoStr(Zoom) + '1');
   TMenuItem(TXhWnd).Checked := False;
   N751.Checked := True;
end;


Technical Articles

This chapter contains several technical articles, giving you an overview of TX Text Control's properties, methods and events working together.

Text Formatting and Views

Headers and Footers

Tables

Marked Text Fields

PDF Export

Resources

Working with XML Files

Server Programming

Specifying a Serial Number in C++


Text Formatting and Views

Coordinate System

Simple Control View

Normal View

Page View

Floating Text

Properties, Methods and Events


Coordinate System

For almost all units of measurement Text Control uses twips. Twip is a fabricated word meaning twentieth of a point. A point which is a unit of measurement for type, is approximately 1/72 inch but often assumed in graphics systems sach as Windows GDI to be exactly 1/72 inch. A twip is 1/20 point and hence 1/1440 inch.

Type size is expressed in units called points. A point is very close to 1/72 inch, so close that it is often defined as exactly 1/72 inch. The point size indicates the height of the characters. For instance, when we speak of 12-point type, we are referring to characters that are 12/72 inch high from the top of the ascenders to the bottom of the descenders.


Simple Control View

The formatting area, which is the area Text Control uses to perform line breaks, is Text Control's control size. This means that every time the control is sized, the text is newly formatted. For this view set the ViewMode property to 4 - Simple Control.

A line break is automatically performed when the current input position reaches the control's right border. When the control's right border is reached without having a break character in a line, no line break is performed and Text Control indicates overflowing text with a vertical mark. This mark is displayed at the control's left or right border, depending on the paragraph alignment setting. When the number of lines exceed the control's height, overflowing text is indicated with a plus mark at the bottom of the control. The current input position, indicated by the caret, can never leave the control. If the user tries to move the caret to overflowing text, the Text Control beeps.

When the Text Control is zoomed, the current control size is also zoomed to adapt the formatting area to the new zooming factor. Its position in relation to its container control or form is also zoomed.

Autoexpanding is only possible in this view. In autoexpanding mode the control's size is automatically expanded to the current text amount. This mode can be set with the AutoExpand property. After Text Control has expanded its control size it sends HExpand and/or VExpand events.

Because the control view has no built-in scroll interface, Text Control has several events to enable a programmer to implement an external scroll interface. The CaretOutBottom, CaretOutLeft, CaretOutRight and CaretOutTop events are sent, when the current input position has been moved outside of the control's visible part. The CaretOut event is sent, when the current input position has been moved to a completely invisible control and the AutoScroll event is sent during extension of a text selection with the mouse. All of these events are only possible in the simple control view.


Normal View

With the PageWidth and PageHeight properties the formatting area can be changed by the programmer. This is necessary to realize a text editor that formats the text accordingly to a certain page width. The ViewMode property must be set to 0 - Normal for this view. In normal view the formatting height - the amount the user can scroll - depends on the current amount of text.

When the formatting width and/or height is greater than the current control size and the caret reaches the control's borders, scrolling is performed automatically to make the new input position visible. In addition, a horizontal and/or a vertical scroll-bar can be used to scroll to text parts outside of the client area without changing the current input position. Scrollbars can be set through the ScrollBars property.

If the Text Control is sized the text is not newly formatted and if the Text Control is zoomed the control's size and position are not changed. If the control is sized, visible scrollbars are automatically hidden when they are no longer needed. Conversely, previously hidden scrollbars are automatically shown when the control's size becomes smaller.


Page View

When the ViewMode property is set to 2 - Page View, Text Control shows pages with margins and borders. The number of pages depends on the amount of text.

The PageWidth and PageHeight properties define the extension of the page including its margins. Page margins have a default value of one inch and can be changed through the PageMarginB, PageMarginL, PageMarginR and PageMarginT properties.

Like for many other extension settings, Text Control uses twentieths of a point to define the formatting area. This unit is often used in combination with text processing applications or fonts and is called TWIP. One TWIP is a 1/1440th of an inch.

In the normal view and in the page view Text Control has a built-in scroll interface. Text Control sends HScroll and VScroll events when it scrolls automatically. The current scroll positions can be obtained or set with the ScrollPosX and ScrollPosY properties.

Only in the Page View headers and footers are visible. For more information how to handle headers and footers see Technical Articles - Headers and Footers.


Floating Text

The default setting of the ViewMode property is 3 - Floating Text. In this setting the text is formatted depending on the control's width but it is not limited to the control's height.


Properties, Methods and Events

For a list of all properties, methods and events that can be used to program with text formatting, text view and scrolling see the chapters Programming Categories - Page and Document Settings and Programming Categories - Scrolling.


Headers and Footers

Using Headers and Footers

Programming Headers and Footers

Properties, Methods and Events


Using Headers and Footers

Headers and footers are only visible when the ViewMode property has been set to Page View.

Headers and footers are parts of a document. The HeaderFooter property determines whether headers and footers, only headers or only footers are contained. Additionally special headers and/or footers for the first page can be specified with this property. To edit a header or footer, it must be activated either with the HeaderFooterActivate method or with a mouse double-click in a header's or footer's area. An activated header or footer gets the input focus and its border is shown with a dotted frame. When a header or footer is activated, the main text is displayed in gray, otherwise a header's or footer's text is displayed in gray. Text Control fires HeaderFooterActivated and HeaderFooterDeactivated events to inform the application about activation or deactivation of headers or footers.

The HeaderFooterStyle property allows the following style settings:

  • Activation can be performed with mouse double-clicks and/or single mouse clicks.
  • The border of an activated header or footer can be solid, dotted or unframed.

The default style setting is a dotted frame and a mouse interface that activates a header or footer with double-clicks.

By default the top of a header has a distance of one centimeter from the top of the page and the bottom of a footer has a distance of one centimeter from the bottom of the page. With the HeaderFooterPosition property these values can be changed. The height of a header or footer depends on the header's or footer's current text.

When a document is loaded or converted from another format, contained headers and footers are automatically displayed. The HeaderFooter property returns the information which headers and/or footers the current document contains.


Programming Headers and Footers

Headers and footers are separate text parts which are independent of the main text. When the user alters the text or the text format, for example with a connected button bar, Text Control uses the current input focus, to determine whether the text format of a header, a footer or the main text is changed. The same occurs when the text is manipulated from programming code. For example when a table is inserted from a menu with the TableInsert method, the current input focus determines whether the table is inserted in a header's or footer's text or in the main text.

In addition to this default text part selection, a programmer can use the HeaderFooterSelect method to use a certain property with a certain text part. For example the following code alters the text of a header:

TXTextControl1.HeaderFooterSelect txHeader
TXTextControl1.Text = "This is the header's text"
TXTextControl1.HeaderFooterSelect 0

The first line selects the header, independent of the current input focus, the second line alters the text of the header and the third line returns to the default selection mode. There can be more than one property or method call between the two HeaderFooterSelect calls.

Almost all properties and methods can be used in this way with some exceptions. The following is a complete list of properties and methods which can be used with headers and footers:

  • all properties and methods to handle character formatting
  • all properties and methods to handle paragraph formatting
  • all properties and methods to handle marked text fields
  • all properties and methods to handle hypertext links
  • all properties and methods to handle tables
  • all properties and methods to handle images, text frames and objects
  • CurrentInputPosition Property
  • Find Method
  • FindReplace Method
  • FormatSelection Property
  • RTFSelText Property
  • SelLength Property
  • SelStart Property
  • SelText Property
  • TabKey Property
  • Text Property

The following methods can only be used in conjunction with the HeaderFooterSelect method:

  • Load Method
  • LoadFromMemory Method
  • LoadSaveAttribute Method
  • Save Method
  • SaveToMemory Method
  • SaveToMemoryBuffer Method


Properties, Methods and Events

For a list of all properties, methods and events that can be used to program with tables see the chapter Programming Categories - Headers and Footers.


Tables

Using Tables

Programming with Table Identifiers

Properties, Methods and Events


Using Tables

Tables can be inserted into a Text Control either with the TableInsert method or via the Load method as part of a document formatted with the RTF or HTML formats. Text Control treats a table as a number of cells organized in rows and columns. Each cell can have as many lines and paragraphs as required. Paragraph formatting is performed in relation to a cell's borders. Each cell has a position and an extension in the document, within this area a cell's frames and text are drawn along with its paragraph and character formatting attributes. There can be a distance between the frame and the text.

Text can be selected either within a single cell or in steps of complete cells or rows. When a selection is deleted inside a table only the text is deleted. To delete one or more complete rows use the TableDeleteLines method. Tables can be copied to the clipboard and pasted from the clipboard. When a table is inserted at the first position of another table or immediately behind another table and both tables have the same number of columns they are combined into a single table. The insertion of one table inside another table is not possible.

A table's attributes are its frame width, distance between frame and formatted text, and background color. To alter the attributes of a table or part of a table, cells must be selected. Then a built-in dialog box can be opened with the TableAttrDialog method. When the selection extends over several tables or tables mixed with text, attributes cannot be changed. To get information about whether attributes can be changed or tables can be inserted or deleted, for example to implement a menu, the TableCanChangeAttr, TableCanDeleteLines and TableCanInsert properties can be used.

When the current input position is inside a table, the ruler shows the positions of all the cells in a table's row and the formatting attributes of the cell the input position belongs to. Then the cells' positions and extensions can be changed with a built-in mouse interface.


Programming with Table Identifiers

Each table can have an user-defined identifier which a programmer can set with the TableInsert method. Setting the identifier is not necessary but recommended when a table's text or attributes are to be changed from the program instead from an end-user. The user-defined identifier need not to be unique and remains valid if a table is saved and reloaded. When no identifier is set Text Control returns an own-selected one, which is unique and does not remain valid if a table is saved and reloaded.

When a table or a part of a table is inserted inside another table the inserted table becomes a part of the existing table and the inserted table's identifier is lost.

When a table with a user-defined identifier is inserted outside of all existing tables a new table is created and the table's identifier remains valid. Text Control informs the program with a TableCreated event that a new table has been created. The programmer can change the table identifier sent with the event by setting the NewTableId parameter of the event.

When a table is inserted from another application, which means it cannot have a user-defined identifier, Text Control sends an own-selected identifier with the TableCreated event and the program can change it.

When tables are imported with the Load method, TableCreated events occur only when text is inserted into an existing document or when an imported table has no user-defined identifier. Otherwise when a table with a user-defined identifier is saved and reloaded no event occurs.

When a table is completely deleted Text Control informs the program with a TableDeleted event.

The following properties and methods can be used with table identifiers to get information or to set table attributes regardless whether the current input position is or is not inside this table:

Property/Method | Description
TableCellText Property | Gets or sets the text contents of a certain table cell.
TableColumns Property | Gets a table's number of columns.
TableRows Property | Gets a table's number of rows.

When more than one table with a certain identifier exists, these properties and methods perform the operation with the original inserted table. In chains of linked windows these properties and methods can be used with any Text Control in the chain regardless of which control contains the table.


Properties, Methods and Events

For a list of all properties, methods and events that can be used to program with tables see the chapter Programming Categories - Tables.


Marked Text Fields

Using Marked Text Fields

Editing Marked Text Fields

Relating data to a Marked Text Field

Special Types of Marked Text Fields

Properties, Methods and Events


Using Marked Text Fields

Fields can be inserted into a Text Control either with the FieldInsert method or via the Load method as a part of a document. The whole communication works with unique numbers returned by this method or defined by the user. To communicate with a field, the field must be previously set as the current field with the FieldCurrent property.

The current text can then be changed or retrieved with the FieldText property and a field can be deleted with the FieldDelete method. To get a field's position, either geometrically or as character position, the properties FieldPosX, FieldPosY, FieldStart and FieldEnd can be used. To get the number of the next field in the text or to enumerate all fields, the FieldNext method can be used.

Special attributes can be set with the FieldChangeable and FieldDeleteable properties. These attributes can prevent a field from beeing deleted or the text of a field from being changed. Further attributes which can help the end-user to edit the field's contents are described in the next chapter.

With different events Text Control informs the application about special conditions. The FieldClicked and FieldDblClicked event inform the application about mouse clicks, FieldEntered and FieldLeft indicate whether the current input position has been moved into or from a field. The FieldSetCursor event can be used to define the cursor when it is moved over a field. The default cursor is the up-arrow cursor. The FieldChanged event occurs when the text of a field has been altered, and the FieldDeleted and FieldCreated event occur when fields have been deleted or created while inserting or deleting text with the keyboard or the clipboard.


Editing Marked Text Fields

When marked text fields are used in an editable Text Control and these fields are editable, the end-user can alter the contents of the field like any other text. Because it is not always unique whether the current input position is or is not inside a field some field attributes have been implemented to help the end-user to edit fields. These attributes can be used in any combination and must be set with the FieldEditAttr property.

When the current input position is in front or behind a field the next inserted character can either belong to the field or to the text outside the field. In normal editing mode an inserted character has the attributes of its preceding character which means that inserted text just behind a field belongs to the field and inserted text in front of a field does belong to the text in front of the field. To solve these problems extended editing features can be defined for every field with the FieldEditAttr property. It implements a second input position at the beginning and the end of the field. The end-user can switch between the two positions with the left and right arrow keys. This is especially important when a marked text field is at the beginning or the end of the complete text. For example when a field is at the end of the text the end-user can press CTRL+END to reach the text end. When this position is also the end of a marked text field the right arrow key can be pressed when the next inserted character should not belong to the field.

To help the end-user to find the correct position, additional settings can be performed which change the caret's width when it is inside a marked text field or display the complete text of a field with a gray background when the current input position is inside this field.

Each of the described attributes can be defined for a single field in any combination which means that different kinds of marked text fields can be implemented in a single Text Control.


Relating data to a Marked Text Field

For each marked text field Text Control can store any data that can be set with the FieldData property. For example when a Text Control is used to show the contents of a database a marked text field can be created for each database field. The database's field names can then be related to the Text Control's marked text fields using the FieldData property.

Other parts of the program can use the FieldData property to retrieve the name of the database field to which a marked text field is linked. For example when the user has clicked on a marked text field, the FieldData property can be used with the field identifier, which has been specified through the FieldClicked event. The property then retrieves the name of the database field the user has clicked on.

The FieldData property accepts strings and numbers. When a marked text field is copied via the clipboard or saved to a file the data belonging to the field is also copied or saved. The usage of the FieldData property does not change the current text contents of a marked text field. When new data is set, all previously set data is overwritten independently of the kind of data involved.


Special Types of Marked Text Fields

Text Control supports special types of marked text fields that can be defined with the FieldType property. The following types are possible:

Type | Description
txFieldExternalLink | This field defines the source of a hypertext link to a location outside of the document.
txFieldInternalLink | This field defines the source of a hypertext link to a location in the same document.
txFieldLinkTarget | This field defines the target of a hypertext link.
txFieldPageNumber | This field displays the current page number. It can only be used in headers or footers.
txFieldAllPages | This field displays the number of pages in the document or section. It can only be used in headers or footers.
txFieldHighlight | This field defines a piece of text that can be highlighted.
txFieldTopic | This field defines a position in a document that is the beginning of a topic.
txFieldMSWord | This field defines a Microsoft Word field.
txFieldHighEdit | This field defines a Heiler HighEdit field.

All of these fields have the same general properties as standard marked text fields with the following exceptions: Fields of the type txFieldLinkTarget or txFieldTopic define text positions in a document. Therefore as they have no visible text, they cannot be edited and have no extended edit mode. Fields of the type txFieldPageNumber or txFieldAllPages can only be used in headers or footers.

For each of the special field types Text Control handles some additional data, called type-related data. These data can be set or returned with the FieldTypeData property. For the types txFieldExternalLink and txFieldInternalLink these data are the information to where the link points. This can be an address or a file name and/or the name of a target in a document. Targets in documents can be realized with marked text fields, which have the type txFieldLinkTarget. These fields can have a name that is saved as type-related data. When the user clicks on a field of the type txFieldExternalLink or txFieldInternalLink a FieldLinkClicked event is fired including the information to where the link points. The FieldGoto method can be used to scroll to a target position and the FieldNext method can be used to enumerate all fields of a certain type.

To insert a field of a special type from programming code, use the FieldInsert method first and then set the type and its data. The following Basic example inserts a field that represents a link to the Text Control homepage:

Dim Field As Integer
TXTextControl1.FieldInsert "visit the Text Control homepage"
Field = TXTextControl1.FieldCurrent
TXTextControl1.FieldType(Field) = txFieldExternalLink
TXTextControl1.FieldTypeData(Field)  = _
      "http://www.textcontrol.com"

When a user clicks on this marked text field, a FieldLinkClicked event is fired, containing the address of the homepage. To insert a field of the type txFieldLinkTarget, the created field must not have text. The following Basic example creates a field that represents such a target:

Dim Field As Integer
TXTextControl1.FieldInsert ""
Field = TXTextControl1.FieldCurrent
TXTextControl1.FieldType(Field) = txFieldLinkTarget
TXTextControl1.FieldTypeData(Field) = "first target"

This creates a field with the name "first target". The FieldGoto method can be used to scroll to this target:

When HTML, RTF or Word documents are loaded, source and target fields for hypertext links are automatically created. To perform this, set the txEnableLinks attribute with the LoadSaveAttribute property before using the Load method.

Fields of the type txFieldPageNumber display the current page number and can only be used in headers or footers. The following Basic example inserts a page number field:

TXTextControl1.FieldInsert ""
TXTextControl1.FieldType(TXTextControl1.FieldCurrent) = _
      txFieldPageNumber

Fields of the type txFieldHighlight can be used to mark pieces of text in a document that can be highlighted. This is useful, for instance, to highlight occurrences of a word found during a global search. The highlight color is stored as additional data for these fields. The FieldGoto method enables the programmer to scroll fom highlight to highlight. When RTF documents are loaded with the Load method and the txEnableHighlights attribute has been set previously with the LoadSaveAttribute property, all RTF '\cbN' keywords are automatically converted to fields of the type txFieldHighlight. N is the index of a color in the RTF color table.

Fields of the type txFieldTopic are text positions in a document defining the beginning of a topic. The FieldGoto method can be used to scroll to a topic with a certain number. When RTF documents are loaded with the Load method and the txEnableTopics attribute has been set previously with the LoadSaveAttribute property, all RTF '\sect' keywords are automatically converted to fields of the type txFieldTopic. These topics are numbered from 1 to n in the order they appear in the RTF document.

TX Text Control supports field formats of other applications such as Microsoft Word. Fields of the type txFieldMSWord and txFieldHighEdit provide an interface to retrieve and change the data and parameters of such fields. Currently supported formats are the Microsoft Word Field Format, the format of Microsoft Word Form Fields and the field format of the Heiler HighEdit component. Because these formats are not compatible, the user must specify the format when a document is loaded. The following code imports all MergeField and PrintDate fields contained in a RTF document that has been created with Microsoft Word:

[Visual Basic]
TXTextControl1.LoadSaveAttribute(txLoadMSWordFields) = True
TXTextControl1.LoadSaveAttribute(txMSWordFieldTypeNames) = "MERGEFIELD" + Chr(9) + "PRINTDATE"
TXTextControl1.Load "c:\invoice.rtf", 0, 5, False

After the document has been loaded all MergeField and PrintDate fields are available through the fields of TX Text Control.

The field's parameters are stored as a tab separated string in the TXTextControl.FieldTypeData property. The following is the format of a MergeField defined through Microsoft Word:

MERGEFIELD FieldName [Switches]

For example: MERGEFIELD Address \* Upper \v

For further information about the switches and their meaning, please refer to Microsoft's Field Reference:

http://www.textcontrol.com/in/msofficefieldreference.htm

In this example the FieldName is Address and there are two switches specifying some formatting options. The TXTextControl.FieldTypeData property string then contains three separated strings, the first of which is the FieldName and the others are the switches.

The following code iterates through all fields imported with the example above and sets the visible text of the address field:

[Visual Basic]
FieldID = TXTextControl1.FieldNext(FieldID, &H8000)
Do While FieldID > 0
  TXTextControl1.FieldCurrent = FieldID
  Dim parameters() As String
  parameters = Split(TXTextControl1.FieldTypeData(FieldID), Chr(9))

  If parameters(0) = "MERGEFIELD" And parameters(1) = "Address" Then
    TXTextControl1.FieldText = "Bakerstreet, London"
  End If

  FieldID = TXTextControl1.FieldNext(FieldID, &H8000)
Loop

TX Text Control also supports importing and exporting of Microsoft Word form fields. These fields can be imported specifying FORMCHECKBOX, FORMDROPDOWN or FORMTEXTBOX with the TXTextControl.LoadSaveAttribute property. Microsoft Word form fields also have parameters, that can be edited in Microsoft Word with the Form Field Options dialog box. TX Text Control provides these parameters through the TXTextControl.FieldTypeData property using the XML syntax of the Office Open XML Format.

To learn more about the Office Open XML Format, please refer to the official ECMA standard:

http://www.textcontrol.com/in/ecmaofficeopenxmlfileformats.htm


Properties, Methods and Events

For a list of all properties, methods and events that can be used to program with marked text fields see the chapters Programming Categories - Text Fields and Programming Categories - Hypertext Links.


PDF Export

The Portable Document Format (PDF) is mainly used to provide a way to exchange documents between systems without changes to the document formatting. Using PDF, a document will retain it's formatting and layout when being printed or displayed on different machines or operating systems. TX Text Control can export all supported formats to PDF and PDF/A.

Exporting Documents as PDF Files

TX Text Control offers two different PDF versions to save a document to:

  • Standard PDF version 1.3, compatible to Acrobat 4.x and higher
  • PDF/A-1b, ISO standard

PDF/A is a format that has been created for long-term archiving of electronic documents. This PDF standard states that the created PDF file must be 100 % self-contained, e.g. all the information, that is necessary to display the content must be embedded in the file. Furthermore, audio and video content is forbidden as well as JavaScript and any executable code. Also, encryption is not allowed.

The PDF/A standard is based on the PDF Reference Version 1.4 from Adobe Systems Inc. and has been published as an ISO standard on October 1, 2005.

TX Text Control's PDF filter can export documents to PDF/A-1b, so that documents can be archived in compliance to ISO standards.

Using PDF/A in TX Text Control

To export any content in TX Text Control to a PDF/A-1b file, the Save method has to be used with the format value 14 (Adobe Portable Document Format Archive (PDF/A)).

To export the page size of a document to PDF, the ViewMode must be set to 2 (Page View).

Basic Steps to Create a PDF/A Document in an Application

1. The ViewMode property has to be set to 2.

2. TXTextControl.FontSettings has to be set to 2.

3. The document can now be saved to PDF/A with the Save method.

The usage of fonts can be restricted with the FontSettings property.

Please note that not every font can be embedded using PDF/A, which may have different reasons: Either a font's license forbids embedding or a device dependent font is used.

TX Text Control includes an advanced algorithm to replace any font that can not be embedded.


Resources

Text Control has several built-in resources like information strings, error messages and dialog boxes. These resources are available in different languages. When a new control is created Text Control selects the current set system language as the default one. With the Language property this setting can be altered independent of the system language. The description of the Language property lists all currently available built-in languages. To alter the language of the Button Bar and Status Bar the appropriate Language properties must be used.

To display resources in additional languages external resource libraries can be built and then set with the ResourceFile property. A resource library is a dynamic link library that only contains resources. The ResourceKit subdiretory contains the basic files to create such a DLL file. The following is a list of these files:

  • TXRES.C (Contains the DLL's entry point)
  • TXRES.RC (Contains Text Control's resources in English)
  • TXRES.H (Contains the definitions of all resource identifiers)

Furthermore Microsoft Visual C++ project files are contained that can be used to build the resource library.

The TXRES.RC file has the following contents:

  • Dialog box templates for the built-in dialog boxes.
  • String tables that contain information strings, error messages and the status strings of the Status Bar. Strings must not be larger than 255 characters.
  • Bitmaps for the bold, italic and underline buttons of the button bar. The bitmap files are in the \BMP subdirectory.

To avoid conflicts with other programs that also uses own resources or with future versions of TX Text Control the following points are important:

  • The resource library should have a unique file name. The resource kit project builds a DLL file named TXRES.DLL. This name should be changed.
  • The resource library should be placed in the same directory as the final application. Get the full path name of the apllication's executable file at run time and specify the resource library's file name including this path when setting the ResourceFile property.

At runtime Text Control determines resources in the following way:

  • The Language property is initialized with the system default language. If the system language is not built-in, Text Control displays English resources.
  • When the Language property has been changed with an identifier of a built-in language, Text Control displays resources in this language independent of the system language.
  • When the ResourceFile property has been set, Text Control tries to load the resources from this library. In this case the Language property is ignored. When the resource library does not contain a needed resource or when the specified file could not be found, Text Control displays English resources without reporting an error.
  • Setting the ResourceFile and Language properties of a Text Control does not automatically set the appropriate properties of a connected Button Bar or Status Bar to the same values. These properties must be changed independently.


Working with XML Files

Loading and Saving XML Files

Editing XML Files

Programming XML Documents

Inserting and Deleting XML Elements


Loading and Saving XML Files

Text Control offers several built-in features to edit and to manipulate XML files. XML files can be loaded and saved like all other files using the Load or Save method.

When an XML file is loaded Text Control considers the corresponding document type description file (DTD) and checks the document for validation. If the document is invalid (which means that it does not fulfill the rules in the DTD) an XMLInvalid event occurs, however, Text Control still loads the document's text and its formatting styles. The document can then be edited as a normal text document with all the editing features Text Control offers.

Otherwise if the document is valid according to the corresponding DTD Text Control loads the document's text and formatting styles and switches to a special XML editor mode which guarantees that the document remains valid during editing. This article describes how the XML editor mode works and how an application can manipulate an XML document. The XMLEditMode property informs about the state of the XML editor.

If an XML document is not well-formed (which means that it contains invalid XML syntax) an XMLNotWellFormed event occurs and the document is not loaded. Both the XMLInvalid event and the XMLNotWellFormed event informs the application about the positon in the file where the error occurs and the error's reason.

During loading, Text Control looks for corresponding formatting styles contained in a CSS file. If such a file could be found Text Control loads the styles and displays all formatting attributes. All further editing and manipulation of the XML Document can be performed in WYSIWYG mode.

Because an XML document becomes invalid if it is inserted into another existing document, Text Control does not load an XML document if the CurSelection parameter of the Load method is set to True.

If an XML document is saved using the Save method only the document's text is saved into the XML file. To save the document's formatting styles into the corresponding CSS file a second call of the Save method must be performed. Changing and saving the document's DTD is not supported. Text Control also does not support the creation of completely new XML documents.


Editing XML Files

XML documents consist of elements. Some of these elements contain the document's text, other elements represent the document's structure. Assume the following XML document that contains a list of addresses:

<?xml version="1.0"?>
<?XML:stylesheet type="text/css" href="addresses.css"?>
<!DOCTYPE Addresses SYSTEM "addresses.dtd">
<Addresses>
   <DocumentHeadline>Addresses</DocumentHeadline>
   <AddressTable>
      <Address>
         <Name>Jack Miller</Name>
         <Street>Baker Street</Street>
         <City>New York</City>
      </Address>
      <Address>
         <Name>Tom Baker</Name>
         <Street>Miller Street</Street>
         <City>Los Angeles</City>
      </Address>
      <Address>
         <Name>Bill Taylor</Name>
         <Street>Old Street</Street>
         <City>Washington</City>
      </Address>
   </AddressTable>
</Addresses>

In this example the elements DocumentHeadline, Name, Street and City contain the document's text, the other elements Addresses, AddressTable and Address are structural elements without any text. After this document has been loaded Text Control displays it WYSIWYG with the formatting styles found in the specified CSS file and automatically switches to the XML editor mode. In this mode, text can be inserted or deleted like in any other document. Text selections are possible only inside of single XML elements. If a user tries to select more than one element Text Control expands the selection to its maximum which is the complete text of the single element.

Like in tables the TAB (Shift TAB) key can be used to select the complete text of the next (previous) element. Clipboard operations are possible as in any other document, but if text is inserted from another document Text Control inserts the text without any formatting attributes.

Because XML documents does not contain formatting attributes they can be changed only via formatting styles. Formatting via the Button Bar changes the attributes of the current style. Formatting via formatting functions is disabled in XML documents. To change formatting attributes either the built-in style dialog boxes or the style collection interface can be used. To make these changes permanent, the new attributes must explicitly be saved in the CSS file.


Programming XML Documents

Text Control exposes the elements of an XML document through collections of XMLElement objects. The "XMLElements property returns an XML collection. There is one collection for each kind of elements. In the example document above there is a collection for all Address elements and another collection for all Name elements. The following line of code gets the collection of the Name elements:

Set NameElements = TXTextControl1.XMLElements("Name")

A collection object has the standard Item method to access a single element. With the XMLElement object's Text method the following line of code displays the content of the second Nameelement:

MsgBox TXTextControl1.XMLElements("Name").Item(2).Text

The Item method is the default method of the XMLElements collection thus the following line of code is equivalent:

MsgBox TXTextControl1.XMLElements("Name")(2)

The Text property of elements containing sub-elements is the complete text of all sub-elements separated through Chr(10) characters. For example the line of code:

TXTextControl1.XMLElements("Address")(2)
= "Paul Baskerville" & Chr(10) & "Jackson Street" & Chr(10) & "London"

in the example above displays:

Tom Baker
Miller Street
Los Angeles

To set a new text with the Text property specify a text string separated through Chr(10) characters:

TXTextControl1.XMLElements("Address")(2)
= "Paul Baskerville" & Chr(10) & "Jackson Street" & Chr(10) & "London"

With a For Each statement a program can iterate through an XML collection. The following example displays all names:

For Each element in TXTextControl1.XMLElements("Name")
   MsgBox element.Text
Next

For development enviroments that do not support For Each processing, the above code is equivalent to the following code using the collection's Count property:

Set elements = TXTextControl1.XMLElements("Name")
For i = 1 To elements.Count
   MsgBox elements(i).Text
Next i

A Text Control XML collection also has an Add and a Remove method to insert or delete elements. This is explained in the following section.


Inserting and Deleting XML Elements

The structure of an XML document is described through a document type description (DTD) either contained inline in the XML file or in a separate DTD file. The following is an example of a DTD file belonging to the XML example above (addresses.dtd):

<!ELEMENT Addresses (DocumentHeadline, AddressTable)>
<!ELEMENT DocumentHeadline (#PCDATA)>
<!ELEMENT AddressTable (Address+)>
<!ELEMENT Address (Name, Street, City)>
<!ELEMENT Name (#PCDATA)>
<!ELEMENT Street (#PCDATA)>
<!ELEMENT City (#PCDATA)>

The DTD allows text only for elements with the #PCDATA statement. Furthermore, the document must have a single document headline and a single address table. The address table can have one or more addresses and each address must have three sub-elements: Name Street and City.

With all of these instructions, inserting or removing elements is allowed only for complete addresses. Inserting or removing one of the other elements results in an invalid document and an XMLInvalid event occurs if a program tries it.

To insert an address first create a new XMLElement object, initialize it with text and then use the Address collection's Add method:

Dim NewAddress As Object
Set NewAddress = CreateObject("TIS.TX.XMLElement.24)
NewAddress.Text = "Paul Baskerville" & Chr(10) & "Jackson Street" & Chr(10) & "London"
TXTextControl1.XMLElements("Address").Add NewAddress, , 2

This code inserts the new address after the second address in the document. Using the Add method's before parameter an element can also be inserted before a certain element.

The following line of code removes the address just inserted:

TXTextControl1.XMLElements("Address").Remove(3)

Because the DTD enforces at least one address, trying to remove the last address also results in an invalid document and an XMLInvalid event occurs.


Server Programming

Text Control can be enabled to work as an automation server in scripting engines such as Windows Scripting Host or Internet Information Server. Text Control offers the EnableAutomationServer method that must be called first after creating the automation object.

All Text Control properties and methods can be used with the exception of those needing a visible surface like dialog boxes, toolbars and all features manipulating the display of a document.

Property Overview

The following is a list of properties and methods that cannot be used when Text Control works as an automation server:

Property/Method | Description
BackStyle Property | Returns or sets a value indicating whether the background of a Text Control is transparent or opaque.
ButtonBarHandle Property | Specifies the button bar control to be used with a Text Control.
CanCopy Property | Informs whether a part of a Text Control's document has been selected and can be copied to the clipboard.
CanPaste Property | Informs whether the clipboard contains a format that can be pasted into a Text Control's document.
Clip Method | Performs clipboard operations.
ClipChildren Property | Determines whether child controls are excluded from the update area.
ClipSiblings Property | Determines whether sibling controls are excluded from the update area.
ControlChars Property | Specifies whether control characters are visible.
DataText Property | Enables a Text Control to be used as a bound control.
DataTextFormat Property | Determines the data format when Text Control is used as a bound control.
Enabled Property | Returns or sets a value that determines whether a Text Control can respond to user-generated events.
FindReplace Method | Displays a 'Find' or 'Replace' dialog box.
FontDialog Method | Invokes Text Control's built-in font dialog box.
GetLineFromPoint Method | Returns the index of the line which contains a given point.
hWnd Property | Returns a handle to a Text Control.
InputPosFromPoint Method | Returns the text input position belonging to a certain geometric position.
ListAttrDialog Method | Invokes Text Control's built-in dialog box to set the attributes of bulleted and numbered lists.
LockWindowUpdate Property | Disables or reenables redrawing.
MousePointer Property | Returns or sets a value indicating the type of mouse pointer.
ParagraphDialog Method | Invokes Text Control's built-in paragraph attributes dialog box.
Refresh Method | Forces a complete repaint of a Text Control.
RulerHandle Property | Specifies the horizontal ruler control to be used with a Text Control.
VerticalRulerHandle Property | Specifies the vertical ruler control to be used with a Text Control.
SaveToMemory Method | Returns a byte array containing text data in a specified format. Use SaveToMemoryBuffer instead.
ScrollBars Property | Returns or sets a value indicating whether a Text Control has horizontal or vertical scroll bars.
ScrollPosX Property | Specifies the position of the horizontal scroll bar.
ScrollPosY Property | Specifies the position of the vertical scroll bar.
SizeMode Property | Specifies whether the Text Control can be moved or resized at run time.
StatusBarHandle Property | Specifies the status bar control to be used with a Text Control.
StyleDialog Method | Invokes the built-in dialog box for creating, deleting and modifying formatting styles.
TabDialog Method | Invokes the built-in dialog box that enables tabs to be set.
TableAttrDialog Method | Invokes Text Control's built-in table attributes dialog box.
TableInsertDialog Method | Invokes Text Control's built-in table insert dialog box.
PageNumberDialog Method | Invokes Text Control's built-in dialog box for setting formatting attributes of pagenumbers.
ZoomFactor Property | Specifies the zoom factor for a Text Control.


Specifying a Serial Number in C++

If you are not using the TX Text Control with Visual Basic or Delphi you may have to set the license information for the control from your application. This is necessary for distributing your application correctly. Otherwise, you will have the problem that the dialog with the trial version information will be displayed all the time on the end users machine.

Visual C++ is one of the development systems that does not support the licensing model of Visual Basic.

Adding Code to the WM_CREATE Handler

To ensure a correct license for your application you must set the serial information prior any other call to the TX Text Control. Take a look of the following code snippet from the WM_CREATE handler of a Visual C++ sample application:

   ...
   if (CWnd::Create(lpszClassName, lpszWindowName, dwStyle,rect,
      pParentWnd, nID, pContext) == 0)
      return 0;
   WCHAR szLic[] = L"TS-1234567890";
   BSTR bstrKey = SysAllocString(szLic);
   BOOL bSuccess = m_txctrl.Create(NULL, dwStyle, rect,
      this, 1000, NULL, NULL,bstrKey);
   SysFreeString(bstrKey);
   if (!bSuccess)
      return 0;
   ...

The license string must be a valid Text Control serial number. Replace the example string "TS-1234567890" with your serial number.

Note: If you are using the trial version of TX Text Control, you do not have any license information. Please call the Create method with an empty string for the serial number.


Programmming Overview

This part contains an overview of TX Text Control's properties, methods and events sorted by programming categories, lists all used data types and contains a reference of the mouse- and keyboard interface.

Programming Categories

Data Types

Mouse and Keyboard Assignment


Programming Categories

The following provides a complete list of Text Control's properties, methods and events sorted by category.

Character Formatting

Paragraph Formatting

Bullets and Numbered Lists

Headers and Footers

Sections and Pages

Stylesheet Formatting

Built-in Dialog Boxes

Tables

Zooming

Loading, Saving and Database Support

Images, Text Frames and OLE Objects

Hypertext Links

Clipboard Operations

Undo

Printing and Print Preview

Search and Replace

Line and Character Operations

Control Settings

Spell Checking

Text Selections and Character Input

Scrolling

Text Fields

Tool Bars

XML Programming

Stylesheet Programming

Server Programming


Character Formatting

Properties

Property | Description
TXTextControl.TXTextControl.BaseLine | Specifies the baseline alignment for selected text.
TXTextControl.TXTextControl.FontBold | Returns or sets the bold font style.
TXTextControl.TXTextControl.FontItalic | Returns or sets the italic font style.
TXTextControl.TXTextControl.FontName | Returns or sets the font used to display text.
TXTextControl.TXTextControl.FontSize | Returns or sets a value that specifies the size of the font used to display text.
TXTextControl.TXTextControl.FontStrikethru | Returns or sets the strike thru font style.
TXTextControl.TXTextControl.FontUnderline | Returns or sets the underline font style.
TXTextControl.TXTextControl.FontUnderlineStyle | This property determines styles for the FontUnderline property.
TXTextControl.TXTextControl.ForeColor | Returns or sets the color used to display text in a Text Control.
TXTextControl.TXTextControl.TextBkColor | Returns or sets the background color for selected text.

Methods

Method | Description
TXTextControl.TXTextControl.FontDialog | Invokes the Text Control's built-in font dialog box and, after the user has closed the dialog box, specifies whether he has changed something.
TXTextControl.TXTextControl.GrowFont | Increases the font size of each font contained in the current text selection.
TXTextControl.TXTextControl.InsertSymbolDialog | Opens a modeless dialog box which can be used to insert symbol characters.
TXTextControl.TXTextControl.ShrinkFont | Decreases the font size of each font contained in the current text selection.

Events

Event | Description
TXTextControl.TXTextControl.CharFormatChange | Occurs when the formatting attributes of the selected characters have been changed.


Paragraph Formatting

Properties

Property | Description
TXTextControl.TXTextControl.Alignment | Specifies the alignment of text in a Text Control.
TXTextControl.TXTextControl.FrameColor | Returns or sets the background color for selected paragraphs.
TXTextControl.TXTextControl.FrameDistance | Returns or sets the distance between text and paragraph frame for the currently selected paragraph(s).
TXTextControl.TXTextControl.FrameLineColor | Returns or sets the color for the frame lines of selected paragraphs.
TXTextControl.TXTextControl.FrameLineWidth | Specifies the line widths of the currently selected paragraphs' frames.
TXTextControl.TXTextControl.FrameStyle | Returns or sets the style of the currently selected paragraphs' frames.
TXTextControl.TXTextControl.IndentB | Returns or sets an additional bottom distance (in twips) for a paragraph or a selected range of paragraphs.
TXTextControl.TXTextControl.IndentFL | Returns or sets an additional left indent (in twips) for the first line of a paragraph or a selected range of paragraphs.
TXTextControl.TXTextControl.IndentL | Returns or sets the left indent (in twips) for a paragraph or a selected range of paragraphs.
TXTextControl.TXTextControl.IndentR | Returns or sets the right indent (in twips) for a paragraph or a selected range of paragraphs.
TXTextControl.TXTextControl.IndentT | Returns or sets an additional top distance (in twips) for a paragraph or a selected range of paragraphs.
TXTextControl.TXTextControl.Justification | Gets or sets the kind of justification in documents containing Arabic or Hebrew characters.
TXTextControl.TXTextControl.KeepLinesTogether | Gets or sets a value indicating whether a page break is allowed within a paragraph.
TXTextControl.TXTextControl.KeepWithNext | If this property is set to true for a paragraph, it is displayed on the same page as its following paragraph.
TXTextControl.TXTextControl.LineSpacing | Specifies the line spacing for the currently selected paragraphs as a percentage of the font size.
TXTextControl.TXTextControl.LineSpacingT | Specifies the line spacing for the currently selected paragraphs in twips.
TXTextControl.TXTextControl.PageBreakBefore | If this property is set to true for a paragraph, it is always displayed on top of a page.
TXTextControl.TXTextControl.ParagraphCount | Returns the number of paragraphs, the document contains.
TXTextControl.TXTextControl.TabCurrent | Specifies the current tab number for the properties TabPos and TabType.
TXTextControl.TXTextControl.TabPos | Determines the position, in twips, of a certain tab.
TXTextControl.TXTextControl.TabType | Determines the type of a certain tab.
TXTextControl.TXTextControl.TextDirection | Specifies the writing direction.
TXTextControl.TXTextControl.WidowOrphanLines | Gets or sets the number of lines for widow/orphan control.

Methods

Method | Description
TXTextControl.TXTextControl.ChangeTextDirection | Changes the text direction of all selected paragraphs.
TXTextControl.TXTextControl.DecreaseIndent | Decreases the left indent of all paragraphs contained in the current text selection.
TXTextControl.TXTextControl.IncreaseIndent | Increases the left indent of all paragraphs contained in the current text selection.
TXTextControl.TXTextControl.ParagraphDialog | Invokes the Text Control's built-in paragraph attributes dialog box and, after the user has closed the dialog box, specifies whether he has changed something.
TXTextControl.TXTextControl.ParagraphSelect | This method can be used to select the specified paragraph.
TXTextControl.TXTextControl.TabDialog | Invokes the Text Control's built-in dialog box for setting tabs.

Events

Event | Description
TXTextControl.TXTextControl.ParagraphChange | Occurs when the character input position has been moved to another paragraph.
TXTextControl.TXTextControl.ParagraphFormatChange | Occurs when the paragraph attributes of the selected paragraphs have been changed.


Bullets and Numbered Lists

Properties

Property | Description
TXTextControl.TXTextControl.BulletAttribute | This property returns or sets attributes for bulleted lists.
TXTextControl.TXTextControl.ListType | Returns or sets a list type for a paragraph or a selected range of paragraphs.
TXTextControl.TXTextControl.NumberingAttribute | This property returns or sets attributes for numbered lists.

Methods

Method | Description
TXTextControl.TXTextControl.ListAttrDialog | Invokes the Text Control's built-in dialog box for setting attributes of bulleted and numbered lists.


Headers and Footers

Properties

Property | Description
TXTextControl.TXTextControl.HeaderFooter | This property determines which kind of headers and/or footers the document or a section contains.
TXTextControl.TXTextControl.HeaderFooterAtInputPos | Returns which header or footer owns the current text input position.
TXTextControl.TXTextControl.HeaderFooterConnectedToPrevious | This property returns or sets a value specifying whether a header or footer is connected with the header or footer of the previous section.
TXTextControl.TXTextControl.HeaderFooterPosition | This property specifies the position of a header or footer.
TXTextControl.TXTextControl.HeaderFooterStyle | This property determines how headers and footers can be activated and how activated headers and footers appear on the screen.

Methods

Method | Description
TXTextControl.TXTextControl.HeaderFooterActivate | Activates or deactivates a header or footer.
TXTextControl.TXTextControl.HeaderFooterSelect | This method determines whether a certain Text Control property or method manipulates a header or a footer or the main text.
TXTextControl.TXTextControl.PageNumberDialog | This method opens a built-in dialog box to set formatting attributes for the specified pagenumber field.

Events

Event | Description
TXTextControl.TXTextControl.HeaderFooterActivated | Occurs when a header or footer has been activated.
TXTextControl.TXTextControl.HeaderFooterDeactivated | Occurs when a header or footer has been deactivated.


Sections and Pages

Properties

Property | Description
TXTextControl.TXTextControl.ColumnDistance | Sets the distance, in twips, between the columns on a page for the whole document or for a document's section.
TXTextControl.TXTextControl.ColumnLineColor | Returns or sets the color of a dividing line between two page columns, either for the whole document or for a certain section.
TXTextControl.TXTextControl.ColumnLineWidth | Returns or sets the width, in twips, of a dividing line between two page columns, either for the whole document or for a certain section.
TXTextControl.TXTextControl.Columns | Returns or sets the number of columns on a page for the whole document or for a document's section.
TXTextControl.TXTextControl.ColumnWidthsAndDistances | Returns or sets the number of columns on a page including its widths and distances for the whole document or for a document's section.
TXTextControl.TXTextControl.PageBorderAttribute | This property returns or sets page border attributes for the whole document or for a document's section.
TXTextControl.TXTextControl.PageCount | Returns the number of pages, the document contains.
TXTextControl.TXTextControl.PageHeight | Returns or sets the height of the page for the whole document or for a document's section.
TXTextControl.TXTextControl.PageImage | Returns an image of the specified page which can be used with the Picture property of a Form object, PictureBox control or Image control.
TXTextControl.TXTextControl.PageLength | Gets the number of characters of the page, including the page break character at the end of the page.
TXTextControl.TXTextControl.PageMarginB | Returns or sets the bottom page margin for the whole document or for a document's section.
TXTextControl.TXTextControl.PageMarginL | Returns or sets the left page margin for the whole document or for a document's section.
TXTextControl.TXTextControl.PageMarginR | Returns or sets the right page margin for the whole document or for a document's section.
TXTextControl.TXTextControl.PageMarginT | Returns or sets the top page margin for the whole document or for a document's section.
TXTextControl.TXTextControl.PageOrientation | Returns or sets the page orientation, portrait or landscape.
TXTextControl.TXTextControl.PageStart | Gets the number (one-based) of the page's first character.
TXTextControl.TXTextControl.PageViewStyle | Defines the kind of view to display the page background.
TXTextControl.TXTextControl.PageWidth | Returns or sets the width of the page for the whole document or for a document's section.
TXTextControl.TXTextControl.SectionAtInputPos | Returns the number of the section containing the current text input position.
TXTextControl.TXTextControl.SectionBreakKind | Returns or sets the kind of the section break the section starts with.
TXTextControl.TXTextControl.SectionCount | Returns the number of sections, the document contains.
TXTextControl.TXTextControl.SectionCurrent | Returns or sets the section number for the following properties and methods: PageWidth, PageHeight, PageMarginL, PageMarginT, PageMarginR, PageMarginB, PageOrientation, HeaderFooter, HeaderFooterActivate, HeaderFooterSelect, HeaderFooterPosition, HeaderFooterConnectedToPrevious, Columns, PageBorderAttribute, ColumnDistance, ColumnLineWidth, ColumnLineColor, ColumnWidthsAndDistances, SectionRestartPageNumbering, and SectionBreakKind.
TXTextControl.TXTextControl.SectionLength | Gets the number of characters in the section.
TXTextControl.TXTextControl.SectionRestartPageNumbering | Returns or sets a value specifying whether page numbering is restarted at the beginning of a document section.
TXTextControl.TXTextControl.SectionStart | Gets the number (one-based) of the section's first character.

Methods

Method | Description
TXTextControl.TXTextControl.PageSelect | This method can be used to select the specified page.
TXTextControl.TXTextControl.SectionFormatDialog | This method invokes the built-in dialog box to set page settings and to design the headers and footers either for the whole document or for a single section.
TXTextControl.TXTextControl.SectionInsert | Inserts a section break at the text input position or at a specified position.
TXTextControl.TXTextControl.SectionSelect | This method can be used to select the specified section.

Events

Event | Description
TXTextControl.TXTextControl.PageChanged | Occurs when the text input position has been moved to another page.
TXTextControl.TXTextControl.PageFormatChange | Occurs when the page format settings have been changed.
TXTextControl.TXTextControl.SectionChanged | Occurs when the text input position has been moved to another section.


Stylesheet Formatting

Properties

Property | Description
TXTextControl.TXTextControl.StyleCurrent | Returns or sets the formatting style at the current input position or, if text is selected, changes all styles of the selected text to the specified style.

Methods

Method | Description
TXTextControl.TXTextControl.StyleDialog | Invokes the Text Control's built-in dialog box for creating, deleting and modifying formatting styles.

Events

Event | Description
TXTextControl.TXTextControl.StyleChanged | Occurs after the character input position has been moved to a text part formatted with another style.
TXTextControl.TXTextControl.StyleListChanged | Occurs after one or more formatting styles have been added or removed.


Built-in Dialog Boxes

Methods

Method | Description
TXTextControl.TXTextControl.FindReplace | Displays a 'Find' or 'Replace' dialog box.
TXTextControl.TXTextControl.FontDialog | Invokes the Text Control's built-in font dialog box and, after the user has closed the dialog box, specifies whether he has changed something.
TXTextControl.TXTextControl.InsertSymbolDialog | Opens a modeless dialog box which can be used to insert symbol characters.
TXTextControl.TXTextControl.ListAttrDialog | Invokes the Text Control's built-in dialog box for setting attributes of bulleted and numbered lists.
TXTextControl.TXTextControl.LocaleDialog | Invokes the Text Control's built-in language dialog box and, after the user has closed the dialog box, specifies whether he has changed something.
TXTextControl.TXTextControl.ObjectAttrDialog | This method invokes the built-in dialog box for setting attributes of images, text frames and OLE objects.
TXTextControl.TXTextControl.PageNumberDialog | This method opens a built-in dialog box to set formatting attributes for the specified pagenumber field.
TXTextControl.TXTextControl.ParagraphDialog | Invokes the Text Control's built-in paragraph attributes dialog box and, after the user has closed the dialog box, specifies whether he has changed something.
TXTextControl.TXTextControl.PrintDialog | Opens the system printing dialog and prints a Text Control document as specified through the dialog.
TXTextControl.TXTextControl.SectionFormatDialog | This method invokes the built-in dialog box to set page settings and to design the headers and footers either for the whole document or for a single section.
TXTextControl.TXTextControl.StyleDialog | Invokes the Text Control's built-in dialog box for creating, deleting and modifying formatting styles.
TXTextControl.TXTextControl.TabDialog | Invokes the Text Control's built-in dialog box for setting tabs.
TXTextControl.TXTextControl.TableAttrDialog | This method invokes the built-in dialog box for setting table attributes and, after the user has closed the dialog box, specifies whether he has changed something.
TXTextControl.TXTextControl.TableInsertDialog | This method opens a built-in dialog box which offers options to define a new table.


Tables

Properties

Property | Description
TXTextControl.TXTextControl.TableAtInputPos | Returns the table identifier of the table containing the input position.
TXTextControl.TXTextControl.TableCanChangeAttr | This property provides information about whether the attributes of all the selected table cells can be altered.
TXTextControl.TXTextControl.TableCanDeleteColumn | This property provides information about whether table columns can be deleted.
TXTextControl.TXTextControl.TableCanDeleteLines | This property provides information about whether table lines can be deleted.
TXTextControl.TXTextControl.TableCanInsert | This property provides information about whether a table can be inserted.
TXTextControl.TXTextControl.TableCanInsertColumn | This property provides information about whether a table column can be inserted.
TXTextControl.TXTextControl.TableCanInsertLines | This property provides information about whether table lines can be inserted.
TXTextControl.TXTextControl.TableCanMergeCells | This property provides information about whether table cells can be merged.
TXTextControl.TXTextControl.TableCanSplit | Checks whether a table can be split.
TXTextControl.TXTextControl.TableCanSplitCells | This property provides information about whether table cells can be split.
TXTextControl.TXTextControl.TableCellAttribute | Returns or sets attributes of a table cell.
TXTextControl.TXTextControl.TableCellData | Returns or sets a string associated with the specified table cell.
TXTextControl.TXTextControl.TableCellLength | Returns the number of characters in a table cell.
TXTextControl.TXTextControl.TableCellStart | Returns the character index (one-based) of the first character in a table cell.
TXTextControl.TXTextControl.TableCellText | Returns or sets the text of a table cell.
TXTextControl.TXTextControl.TableColAtInputPos | Returns the number of the current input column in a table.
TXTextControl.TXTextControl.TableColumns | Informs about the number of columns a specified table contains.
TXTextControl.TXTextControl.TableGridLines | This property determines whether or not grid lines in tables are visible.
TXTextControl.TXTextControl.TableNestedLevel | Gets the nested level for the specified table.
TXTextControl.TXTextControl.TableRowAtInputPos | Returns the number of the current input row in a table.
TXTextControl.TXTextControl.TableRows | Informs about the number of rows a specified table contains.

Methods

Method | Description
TXTextControl.TXTextControl.TableAttrDialog | This method invokes the built-in dialog box for setting table attributes and, after the user has closed the dialog box, specifies whether he has changed something.
TXTextControl.TXTextControl.TableCellSelect | This method can be used to select a table cell, a table row, a table column or a complete table.
TXTextControl.TXTextControl.TableDelete | This method can be used to delete a complete table from the document.
TXTextControl.TXTextControl.TableDeleteColumn | This method deletes the currently selected table columns or the table column containing the text input position.
TXTextControl.TXTextControl.TableDeleteLines | This method deletes the currently selected table lines or the table line at the current input position.
TXTextControl.TXTextControl.TableFromSelection | This method returns the table identifier of the currently selected table.
TXTextControl.TXTextControl.TableGetOuter | This method returns a table's outer table.
TXTextControl.TXTextControl.TableGetOuterMost | This method returns a table's outermost table.
TXTextControl.TXTextControl.TableInsert | This method inserts a new table in the text.
TXTextControl.TXTextControl.TableInsertColumn | This method inserts a table column left or right of the column with the current input position.
TXTextControl.TXTextControl.TableInsertDialog | This method opens a built-in dialog box which offers options to define a new table.
TXTextControl.TXTextControl.TableInsertLines | This member function inserts table lines above or below the table line with the current input position.
TXTextControl.TXTextControl.TableMergeCells | This method merges all selected table cells.
TXTextControl.TXTextControl.TableNext | This method returns a enumaration number of the table that follows the specified table in the Text Control's current text.
TXTextControl.TXTextControl.TableSelectCells | This method can be used to select a rectangular part of a table defined through two table cells.
TXTextControl.TXTextControl.TableSplit | Splits a table below or above the current input position.
TXTextControl.TXTextControl.TableSplitCells | This method splits all selected table cells.

Events

Event | Description
TXTextControl.TXTextControl.TableCreated | Occurs after a new table has been created as a result of a text insertion via the clipboard.
TXTextControl.TXTextControl.TableDeleted | Occurs after a table has been deleted.
TXTextControl.TXTextControl.TableFormatChanged | Occurs after a table has been formatted with the built-in mouse-interface.


Zooming

Properties

Property | Description
TXTextControl.TXTextControl.ZoomFactor | Specifies the zoom factor for a Text Control.

Methods

Method | Description
TXTextControl.TXTextControl.Zoom | Zooms the contents of the TextControl using the specified option.

Events

Event | Description
TXTextControl.TXTextControl.Zoomed | Occurs when the Text Control has been zoomed.


Loading, Saving and Database Support

Properties

Property | Description
TXTextControl.TXTextControl.DataText | The DataText property is used internally by Visual Basic when a Text Control is used as a bound control.
TXTextControl.TXTextControl.DataTextFormat | When using a Text Control as a bound control, this property specifies if the data which is exchanged with a database is text or binary data.
TXTextControl.TXTextControl.Device | This property returns or sets the device for which the current Text Control document is formatted.
TXTextControl.TXTextControl.LoadSaveAttribute | This property enables an application to specify several attributes that can be used in combination with the Load and Save methods for the following situations: 1.
TXTextControl.TXTextControl.RTFSelText | This property works much like the standard SelText property.
TXTextControl.TXTextControl.Text | Returns or sets the complete text of a Text Control.

Methods

Method | Description
TXTextControl.TXTextControl.Append | Appends text in a certain format from a file and inserts it at the end of the current document.
TXTextControl.TXTextControl.AppendFromMemory | Appends text in a certain format from a buffer and inserts it at the end of the current document.
TXTextControl.TXTextControl.Load | Loads text in a certain format from a file and inserts it into the Text Control.
TXTextControl.TXTextControl.LoadFromMemory | Loads text in a certain format from a buffer and inserts it into the Text Control.
TXTextControl.TXTextControl.ResetContents | Deletes the complete contents of a Text Control including tables, objects, marked text fields and headers and footers.
TXTextControl.TXTextControl.Save | Saves data in a file with a specified format.
TXTextControl.TXTextControl.SaveToMemory | Returns a one-dimensional byte array containing text data in a specified format.
TXTextControl.TXTextControl.SaveToMemoryBuffer | Returns a buffer containing text data in a specified format.

Events

Event | Description
TXTextControl.TXTextControl.Change | Indicates that the contents of a Text Control have changed.


Images, Text Frames and OLE Objects

Properties

Property | Description
TXTextControl.TXTextControl.ImageDisplayMode | Provides several modes to set the way in which images are displayed or refreshed.
TXTextControl.TXTextControl.ImageExportCompressionQuality | Determines a value between 1 and 100, which is the quality of a lossy data compression used, if the image is saved.
TXTextControl.TXTextControl.ImageExportFilename | Determines the file name of an image used if a document is saved.
TXTextControl.TXTextControl.ImageExportFilters | This property returns a string which specifies the available filters for exporting images.
TXTextControl.TXTextControl.ImageExportFormat | Determines the format used if an image is saved.
TXTextControl.TXTextControl.ImageExportMaxResolution | Determines the maximum resolution in dots per inch used, if the image is saved.
TXTextControl.TXTextControl.ImageFilename | Determines the image file name of an inserted image.
TXTextControl.TXTextControl.ImageFilters | This property returns a string which specifies the available image filters.
TXTextControl.TXTextControl.ImageSaveMode | Determines whether the image is stored through its data or through its file reference.
TXTextControl.TXTextControl.ObjectCurrent | Returns or sets the current object for setting properties of images, text frames or OLE objects.
TXTextControl.TXTextControl.ObjectDistance | Specifies the distance (in twips) between an image, text frame or OLE object and the text that flows around it.
TXTextControl.TXTextControl.ObjectHeight | Returns or sets the natural height, in twips, of an image, text frame or OLE object.
TXTextControl.TXTextControl.ObjectInsertionMode | Gets or sets an image's, text frame's or OLE object's formatting behaviour.
TXTextControl.TXTextControl.ObjectItem | Returns a reference to an OLE object.
TXTextControl.TXTextControl.ObjectName | Defines a name for an image, text frame or OLE object.
TXTextControl.TXTextControl.ObjectPosX | Gets or sets the imags's, text frame's or OLE object's horizontal position, in twips.
TXTextControl.TXTextControl.ObjectPosY | Gets or sets the image's, text frame's or OLE object's vertical position, in twips.
TXTextControl.TXTextControl.ObjectScaleX | Specifies the object's horizontal scaling factor as a percentage.
TXTextControl.TXTextControl.ObjectScaleY | Specifies the object's vertical scaling factor as a percentage.
TXTextControl.TXTextControl.ObjectSizeMode | Specifies whether an inserted image, text frame or OLE object can be moved or resized at run time.
TXTextControl.TXTextControl.ObjectTextflow | Gets or sets a value in which way text flows around an image, text frame or OLE object.
TXTextControl.TXTextControl.ObjectTransparency | Specifies the object's transparency.
TXTextControl.TXTextControl.ObjectUserId | Defines a user-defined identifier for an image, text frame or OLE object.
TXTextControl.TXTextControl.ObjectWidth | Returns or sets the natural width, in twips, of an image, text frame or OLE object.
TXTextControl.TXTextControl.TextFrameBackColor | Returns or sets the background color of a text frame.
TXTextControl.TXTextControl.TextFrameBorderWidth | Specifies the width, in twips, of a text frame's border line.
TXTextControl.TXTextControl.TextFrameInternalMargin | Specifies the distance (in twips) between a text frame's border line and the text.
TXTextControl.TXTextControl.TextFrameMarkerLines | This property determines whether or not marker lines for text frames are visible.

Methods

Method | Description
TXTextControl.TXTextControl.ImageInsert | This method inserts a new image anchored to a paragraph.
TXTextControl.TXTextControl.ImageInsertAsChar | This method inserts a new image which is then handled like a single character in the text.
TXTextControl.TXTextControl.ImageInsertFixed | This method inserts a new image at a fixed geometrical position.
TXTextControl.TXTextControl.ObjectAttrDialog | This method invokes the built-in dialog box for setting attributes of images, text frames and OLE objects.
TXTextControl.TXTextControl.ObjectChangeZOrder | Changes the z-order of an image, text frame or OLE object.
TXTextControl.TXTextControl.ObjectDelete | This method deletes an image, text frame or OLE object.
TXTextControl.TXTextControl.ObjectGetFromName | Looks for the object with the specified name.
TXTextControl.TXTextControl.ObjectGetFromUserId | Looks for the object with the specified user identifier.
TXTextControl.TXTextControl.ObjectGetSelected | This method returns the identifier of the currently selected object.
TXTextControl.TXTextControl.ObjectInsert | This method inserts a new OLE object or other control anchored to a paragraph.
TXTextControl.TXTextControl.ObjectInsertAsChar | This method inserts a new OLE object or other control which is then handled like a single character in the text.
TXTextControl.TXTextControl.ObjectInsertFixed | This method inserts a new OLE object or other control at a fixed geometrical position.
TXTextControl.TXTextControl.ObjectNext | This method returns the identifier of the object that follows the specified object in a Text Control's internal list of objects.
TXTextControl.TXTextControl.TextFrameInsert | This method inserts a new text frame anchored to a paragraph.
TXTextControl.TXTextControl.TextFrameInsertAsChar | This method inserts a new text frame, which is then handled as a single character in the text.
TXTextControl.TXTextControl.TextFrameInsertFixed | This method inserts a new text frame at a fixed geometrical position.
TXTextControl.TXTextControl.TextFrameSelect | This method determines whether a certain Text Control property or method manipulates a text frame or the main text.

Events

Event | Description
TXTextControl.TXTextControl.ObjectClicked | Occurs when an object has been clicked on.
TXTextControl.TXTextControl.ObjectCreated | This event specifies that a new object has been created.
TXTextControl.TXTextControl.ObjectDblClicked | Occurs when an object has been double-clicked on.
TXTextControl.TXTextControl.ObjectDeleted | Occurs when an object has been deleted.
TXTextControl.TXTextControl.ObjectGetData | Occurs when a document which contains objects, is saved.
TXTextControl.TXTextControl.ObjectGethWnd | Occurs when a document which contains objects, is loaded.
TXTextControl.TXTextControl.ObjectGetZoom | Occurs when an object's zoom factor is requested.
TXTextControl.TXTextControl.ObjectMoved | Occurs if an image, text frame or OLE object has been moved with the built-in mouse interface.
TXTextControl.TXTextControl.ObjectPrint | Occurs when a document containing objects is printed.
TXTextControl.TXTextControl.ObjectRightClicked | Occurs when an object has been clicked on with the right mouse button.
TXTextControl.TXTextControl.ObjectScrollOut | Occurs when an object is scrolled out of the visible area.
TXTextControl.TXTextControl.ObjectSetData | Occurs when a document which contains objects, is loaded.
TXTextControl.TXTextControl.ObjectSetZoom | Occurs when an object's zoom factor is to be changed.
TXTextControl.TXTextControl.ObjectSized | Occurs if an image, text frame or OLE object has been resized with the built-in mouse interface.
TXTextControl.TXTextControl.TextFrameActivated | Occurs when a text frame has obtained the input focus.
TXTextControl.TXTextControl.TextFrameDeactivated | Occurs when a text frame has lost the input focus.


Hypertext Links

Properties

Property | Description
TXTextControl.TXTextControl.FieldType | This property sets or returns the type of a marked text field.
TXTextControl.TXTextControl.FieldTypeData | This property sets or returns the data that belongs to a marked text field of a special type.

Events

Event | Description
TXTextControl.TXTextControl.FieldLinkClicked | Occurs when a marked text field has been clicked on that represents the source of a hypertext link.


Clipboard Operations

Properties

Property | Description
TXTextControl.TXTextControl.CanCopy | Informs whether a part of a Text Control's document has been selected and can be copied to the clipboard.
TXTextControl.TXTextControl.CanPaste | Informs whether the clipboard contains a format that can be pasted into a Text Control's document.

Methods

Method | Description
TXTextControl.TXTextControl.Clip | Performs Text Control clipboard actions.


Undo

Properties

Property | Description
TXTextControl.TXTextControl.AllowUndo | Determines whether the undo buffer is active or not.
TXTextControl.TXTextControl.CanRedo | Informs whether an operation can be re-done using the Redo method.
TXTextControl.TXTextControl.CanUndo | Informs whether an operation can be undone using the Undo method.

Methods

Method | Description
TXTextControl.TXTextControl.EndUndoAction | Defines the end of an undo action.
TXTextControl.TXTextControl.Redo | This method can be used to redo the last Text Control operation.
TXTextControl.TXTextControl.StartUndoAction | Defines the beginning of an undo action.
TXTextControl.TXTextControl.Undo | This method can be used to undo the last Text Control operation.


Printing and Print Preview

Properties

Property | Description
TXTextControl.TXTextControl.CurrentPages | Returns the number of pages contained in the current document.
TXTextControl.TXTextControl.PrintColors | Specifies whether text colors are printed as colors or in black.
TXTextControl.TXTextControl.PrintDevice | Sets the printer device context for TextContol's built-in printing function.
TXTextControl.TXTextControl.PrintOffset | Determines whether Text Control starts printing exactly at the top left corner of the page, or at the printer's physical printing offset.
TXTextControl.TXTextControl.PrintZoom | Specifies a zoom factor for printing.

Methods

Method | Description
TXTextControl.TXTextControl.PrintDialog | Opens the system printing dialog and prints a Text Control document as specified through the dialog.
TXTextControl.TXTextControl.PrintDoc | Prints a Text Control document or a part of a Text Control document on the default printer.
TXTextControl.TXTextControl.PrintPage | Prints a page of text on the default printer.


Search and Replace

Methods

Method | Description
TXTextControl.TXTextControl.Find | Searches the text in a Text Control for a given string.
TXTextControl.TXTextControl.FindReplace | Displays a 'Find' or 'Replace' dialog box.


Line and Character Operations

Methods

Method | Description
TXTextControl.TXTextControl.GetBaseLinePos | Returns the baseline position of the specified line.
TXTextControl.TXTextControl.GetCharFromLine | Returns the position of a line's first character.
TXTextControl.TXTextControl.GetCharRect | Returns the rectangular area covered by a certain character.
TXTextControl.TXTextControl.GetLineCount | Returns the number of text lines in a Text Control.
TXTextControl.TXTextControl.GetLineFromChar | Returns the index of the line which contains the character with the specified character position.
TXTextControl.TXTextControl.GetLineFromPoint | Returns the index of the line which contains a given point.
TXTextControl.TXTextControl.GetLineRect | Returns the rectangular area covered by a line of text.


Control Settings

Properties

Property | Description
TXTextControl.TXTextControl.AllowDrag | Gets or sets a value indicating whether the control can be a source of a Drag&Drop operation.
TXTextControl.TXTextControl.AllowDrop | Gets or sets a value indicating whether the control can accept data that the user drags onto it.
TXTextControl.TXTextControl.AutoExpand | Specifies whether the control size should expand automatically when the text insertion or format changes results in text that does not fit into the Text Control anymore.
TXTextControl.TXTextControl.BackColor | Returns or sets the background color of a Text Control.
TXTextControl.TXTextControl.BackStyle | Returns or sets a value indicating whether the background of a Text Control is transparent or opaque.
TXTextControl.TXTextControl.BorderStyle | Returns or sets the border style for a Text Control.
TXTextControl.TXTextControl.CaretWidth | This property returns or sets the width of the caret in pixels.
TXTextControl.TXTextControl.ClipboardFormats | Returns an array of Integer values specifying all the data formats which are currently available in the clipboard and which can be pasted into a TextControl document.
TXTextControl.TXTextControl.ClipChildren | This property is only used for Text Controls which act as a container for other Text Controls or embedded objects.
TXTextControl.TXTextControl.ClipSiblings | This property determines the clipping behaviour of each of the child controls which belong to a common container control.
TXTextControl.TXTextControl.ControlChars | Specifies if control characters are visible.
TXTextControl.TXTextControl.DisplayColor | This property gets or sets the display colors of a TextControl.
TXTextControl.TXTextControl.EditMode | Specifies whether the Text Control operates in edit mode or in one of the two read-only modes.
TXTextControl.TXTextControl.Enabled | Returns or sets a value that determines whether a Text Control can respond to user-generated events.
TXTextControl.TXTextControl.FontSettings | Determines which kind of fonts can be used in a document.
TXTextControl.TXTextControl.hWnd | Returns a handle to a Text Control.
TXTextControl.TXTextControl.Language | Determines the language in which Text Control displays dialog boxes and error messages.
TXTextControl.TXTextControl.Locale | Specifies a language for the selected text.
TXTextControl.TXTextControl.LockWindowUpdate | Disables or reenables redrawing.
TXTextControl.TXTextControl.MousePointer | Returns or sets a value indicating the type of mouse pointer displayed when the mouse is over a particular part of a Text Control at run time.
TXTextControl.TXTextControl.PermanentControlChars | Gets or sets a value specifying which control characters are shown permanently on the screen.
TXTextControl.TXTextControl.ResourceFile | Returns or sets the file name of a resource library which Text Control loads to display resources like information strings, error messages and built-in dialog boxes.
TXTextControl.TXTextControl.RightToLeft | Returns or sets a value specifying whether the Text Control's vertical scrollbar is at the left or right border and whether the Text Control has a right or left zoom origin.
TXTextControl.TXTextControl.SelectionViewMode | Specifies whether text selections are displayed with a transparent bitmap or through inverting the text.
TXTextControl.TXTextControl.SizeMode | Specifies whether the Text Control can be moved or resized at run time.
TXTextControl.TXTextControl.SupportedFonts | This property returns a string specifying the names of all available fonts.
TXTextControl.TXTextControl.TabKey | Determines if the keyboard's tab key moves the input focus to the next control or to insert tabulators in the Text Control's text.
TXTextControl.TXTextControl.ViewMode | Returns or sets the mode in which Text Control displays its text contents.
TXTextControl.TXTextControl.WordWrapMode | This property returns or sets the mode how Text Control handles word wrapping in lines without space or other word breaking characters.

Methods

Method | Description
TXTextControl.TXTextControl.GetTextExtent | Returns the extension of the complete text in twips.
TXTextControl.TXTextControl.LocaleDialog | Invokes the Text Control's built-in language dialog box and, after the user has closed the dialog box, specifies whether he has changed something.
TXTextControl.TXTextControl.Paste | Replaces the current selection in the Text Control with the contents of the Clipboard.
TXTextControl.TXTextControl.Refresh | This method forces a complete repaint of a Text Control.

Events

Event | Description
TXTextControl.TXTextControl.ContextMenuOpening | Occurs before a built-in context menu is opened.
TXTextControl.TXTextControl.Error | Occurs when the Text Control reports an error.
TXTextControl.TXTextControl.HExpand | Occurs when the Text Control has changed its window size horizontally.
TXTextControl.TXTextControl.Move | Occurs when a Text Control has been moved with the mouse.
TXTextControl.TXTextControl.Size | Occurs when a Text Control has been resized with the mouse.
TXTextControl.TXTextControl.VExpand | Occurs when the Text Control has changed its window size vertically.


Spell Checking

Properties

Property | Description
TXTextControl.TXTextControl.EnableSpellChecking | Gets or sets a value indicating whether spell checking is active or not.
TXTextControl.TXTextControl.MisspelledWordAtInputPos | Gets the number of the misspelled word at the current text input position.
TXTextControl.TXTextControl.MisspelledWordLength | Gets the length of the misspelled word with the specified number.
TXTextControl.TXTextControl.MisspelledWords | Gets the current number of misspelled words.
TXTextControl.TXTextControl.MisspelledWordStart | Gets the zero-based position of the misspelled word with the specified number.

Methods

Method | Description
TXTextControl.TXTextControl.MisspelledWordDelete | Removes the specified misspelled word from a Text Control document.

Events

Event | Description
TXTextControl.TXTextControl.SpellCheckText | Occurs, if the document's text has been altered and the spelling of the new text must be checked.


Text Selections and Character Input

Properties

Property | Description
TXTextControl.TXTextControl.CurrentInputPosition | Returns or sets an array of three values which specify the page, line and column number of the current text input position.
TXTextControl.TXTextControl.FormatSelection | Specifies whether character and paragraph formatting properties apply to the whole text or to a particular selection only.
TXTextControl.TXTextControl.HideSelection | Specifies whether a text selection is hidden when the Text Control looses the input focus.
TXTextControl.TXTextControl.InsertionMode | Specifies whether text is inserted or overwrites existing text.
TXTextControl.TXTextControl.SelLength | Returns or sets the number of characters selected.
TXTextControl.TXTextControl.SelStart | Returns or sets the starting point of text selected or indicates the position of the insertion point if no text is selected.
TXTextControl.TXTextControl.SelText | Returns or sets the string containing the currently selected text.

Methods

Method | Description
TXTextControl.TXTextControl.GetCaretRect | Returns the rectangular area covered by the caret which indicates the current text input position.
TXTextControl.TXTextControl.InputPosFromPoint | Returns the text input position belonging to a certain geometric position.

Events

Event | Description
TXTextControl.TXTextControl.Click | Occurs when the user presses and then releases a mouse button over a Text Control.
TXTextControl.TXTextControl.DblClick | Occurs when the user presses and releases a mouse button and then presses and releases it again over a Text Control.
TXTextControl.TXTextControl.KeyDown | Occurs when the user presses a key while the Text Control has the input focus.
TXTextControl.TXTextControl.KeyPress | Occurs when the user presses and releases an ANSI key while the Text Control has the input focus.
TXTextControl.TXTextControl.KeyStateChange | Occurs when the character insertion mode or when the state of the NUMLOCK or CAPSLOCK key has been changed.
TXTextControl.TXTextControl.KeyUp | Occurs when the user releases a key while the Text Control has the input focus.
TXTextControl.TXTextControl.MouseDown | Occurs when the user presses a mouse button.
TXTextControl.TXTextControl.MouseMove | Occurs when the user moves the mouse.
TXTextControl.TXTextControl.MouseUp | Occurs when the user releases a mouse button.
TXTextControl.TXTextControl.PosChange | Occurs when the current character input position has been changed.


Scrolling

Properties

Property | Description
TXTextControl.TXTextControl.ScrollBars | Returns or sets a value indicating whether a Text Control has horizontal or vertical scroll bars.
TXTextControl.TXTextControl.ScrollPosX | Specifies the position of the horizontal scroll bar in twips.
TXTextControl.TXTextControl.ScrollPosY | Specifies the position of the vertical scroll bar in twips.

Events

Event | Description
TXTextControl.TXTextControl.AutoScroll | This event occurs when the cursor leaves the visible portion of a Text Control's client area whilst a text selection is being expanded with the mouse.
TXTextControl.TXTextControl.CaretOut | Occurs when the current input position indicated through the caret has been moved to a control that is completely out of the visible area.
TXTextControl.TXTextControl.CaretOutBottom | Occurs when the current input position indicated through the caret has been moved out of the visible area at the bottom.
TXTextControl.TXTextControl.CaretOutLeft | Occurs when the current input position indicated through the caret has been moved out of the visible area at the left side.
TXTextControl.TXTextControl.CaretOutRight | Occurs when the current input position indicated through the caret has been moved out of the visible area at the right side.
TXTextControl.TXTextControl.CaretOutTop | Occurs when the current input position indicated through the caret has been moved out of the visible area at the top.
TXTextControl.TXTextControl.HScroll | Occurs when the horizontal scroll position has been changed.
TXTextControl.TXTextControl.VScroll | Occurs when the vertical scroll position has been changed.


Text Fields

Properties

Property | Description
TXTextControl.TXTextControl.FieldAtInputPos | Returns the field identifier of the field containing the input position.
TXTextControl.TXTextControl.FieldChangeable | Specifies if the contents of a marked text field can be changed by the user.
TXTextControl.TXTextControl.FieldCurrent | Returns or sets the identifier of the current marked text field for the Fieldxxx properties, methods and events.
TXTextControl.TXTextControl.FieldData | This property relates numeric or string data to a marked text field.
TXTextControl.TXTextControl.FieldDeleteable | Specifies whether a marked text field can be deleted by the user.
TXTextControl.TXTextControl.FieldEditAttr | This property returns or sets attributes for advanced editing inside marked text fields.
TXTextControl.TXTextControl.FieldEnd | Returns the end position of a marked text field.
TXTextControl.TXTextControl.FieldLinkTargetMarkers | Gets or sets a value indicating that markers for hypertext targets are shown or not.
TXTextControl.TXTextControl.FieldPosX | Returns the horizontal position of a marked text field.
TXTextControl.TXTextControl.FieldPosY | Returns the vertical position of a marked text field.
TXTextControl.TXTextControl.FieldStart | Specifies the start position of a marked text field.
TXTextControl.TXTextControl.FieldText | Returns or sets the text which is contained within a marked text field.

Methods

Method | Description
TXTextControl.TXTextControl.FieldDelete | Deletes the marked text field specified by the FieldCurrent property, or changes it to simple text.
TXTextControl.TXTextControl.FieldGoto | Sets the current input position to the beginning of the specified marked text field and scrolls the text so that this position is at the top of the control's visible text.
TXTextControl.TXTextControl.FieldInsert | Inserts a new marked text field at the current caret position.
TXTextControl.TXTextControl.FieldNext | This method returns the identifier of the marked text field that follows the specified field in the Text Control's current text.
TXTextControl.TXTextControl.FieldSetInputPos | If the current text input position is a position at the beginning or at the end of a marked text field with a doubled input position, this method can be used to define whether the position is inside or outside the field.

Events

Event | Description
TXTextControl.TXTextControl.FieldChanged | Occurs when the text of a marked text field has been changed.
TXTextControl.TXTextControl.FieldClicked | Occurs when a marked text field has been clicked on.
TXTextControl.TXTextControl.FieldCreated | Occurs when a marked text field has been pasted from the clipboard.
TXTextControl.TXTextControl.FieldDblClicked | Occurs when a marked text field has been double-clicked on.
TXTextControl.TXTextControl.FieldDeleted | Occurs when a marked text field has been deleted.
TXTextControl.TXTextControl.FieldEntered | Occurs when the current input position, indicated by the caret, has been moved to a position that belongs to a marked text field.
TXTextControl.TXTextControl.FieldLeft | Occurs when the current input position indicated by the caret has been moved to a position that does not belong to the marked text field at the previous input position.
TXTextControl.TXTextControl.FieldSetCursor | Occurs when the cursor is moved over a marked text field.


Tool Bars

Controls and Objects

Control/Object | Description
TXTextControl.TXButtonBar | A TXButtonBar control represents a button bar for a Text Control.
TXTextControl.TXRulerBar | A TXRulerBar control represents a ruler bar for a Text Control.
TXTextControl.TXStatusBar | A TXStatusBar control represents a status bar for a Text Control.
TXTextControl.TXTextControl | The TXTextControl control is the main control that is used to display and edit a text document.

Properties

Property | Description
TXTextControl.TXTextControl.ButtonBarHandle | Specifies the button bar control to be used with a Text Control.
TXTextControl.TXTextControl.RulerHandle | Specifies the ruler control to be used as horizontal ruler with a Text Control.
TXTextControl.TXTextControl.StatusBarHandle | Specifies the status bar control to be used with a Text Control.
TXTextControl.TXTextControl.VerticalRulerHandle | Specifies the ruler control to be used as vertical ruler with a Text Control.

Events

Event | Description
TXTextControl.TXTextControl.ConnectTools | MS Access only: Occurs after all Text Controls, Rulers, Button Bars and Status Bars have been created and are ready to be connected.


XML Programming

Controls and Objects

Control/Object | Description
TXTextControl.XMLElement | An XMLElement object is an OLE Automation object that represents an element in an XML document.
TXTextControl.XMLElements | A XMLElements collection object is an OLE Automation object whose members represent all XML elements with a certain tag name.

Properties

Property | Description
TXTextControl.TXTextControl.XMLEditMode | Specifies whether Text Control operates in an edit mode that validates the XML document according to the document's DTD.
TXTextControl.TXTextControl.XMLElements | Returns a collection of all XML elements with the same tag name.

Events

Event | Description
TXTextControl.TXTextControl.XMLInvalid | Occurs when a loaded XML document cannot be validated with the document type definition (DTD) referenced in the document.
TXTextControl.TXTextControl.XMLNotWellFormed | Occurs when a loaded XML document is not well-formed.


Stylesheet Programming

Controls and Objects

Control/Object | Description
TXTextControl.Style | A Style object is an OLE Automation object that represents a formatting style.
TXTextControl.Styles | A Styles collection object is an OLE Automation object whose members represent all formatting styles a Text Control document contains.

Properties

Property | Description
TXTextControl.TXTextControl.Styles | Returns a collection of all formatting styles in a document.


Server Programming

Methods

Method | Description
TXTextControl.TXTextControl.EnableAutomationServer | Enables a Text Control to work as an automation server.


Data Types

The Text Control reference uses the following data types:

Data Type | Description
Byte | Is a one-byte value with the range 0 to 255.
Boolean | Is a two-byte value that can be True or False.
Integer | Is a two-byte value with the range -32,768 to 32,767.
Long | Is a four-byte value with the range -2,147,483,648 to 2,147,483,647
Handle | Is a four-byte value with the range 0 to 4,294,967,295.
String | Is a length-prefixed string of unlimited size.
Variant | Can be any of the previously explained data types, including arrays of these types.


Mouse and Keyboard Assignment

Mouse Assignment

Keyboard Assignment

Additional Mouse and Keyboard Assignment in Tables

Keyboard Assignment for Hyphens


Mouse Assignment

Mouse Action | Reaction of Text Control
Click | Moves cursor to point of click or selects an image or text frame.
Click and Drag | Selects text from point of button down to point where button is released or moves an image, text frame, barcode or chart object.
SHIFT + Click | Extends the selection to the point of click.
Double-click | Selects the word that is clicked on.
Double-click and drag | Extends the selection from word to word.
Triple-click | Selects the paragraph that is clicked on.
Triple-click and drag | Extends the selection from paragraph to paragraph.
PgUp / PgDown | Scrolls the text up or down one client area height minus the height of one line of text. Active only if a vertical scrollbar exists.
CTRL + PgUp / PgDown | Zooms up or down the current document.
SHIFT + PgUp / PgDown | Scrolls the document horizontally.
Drag and Drop on selected text | Selected text is moved to the drop position of the mouse (text drag and drop).
CTRL + Drag and Drop on selected text | Selected text is copied to the drop position of the mouse (text drag and drop).
Click on the selection bar (left or right margin) | Selects the complete row.


Keyboard Assignment

Key Type | Reaction of Text Control
HOME | Moves the caret to the beginning of the line.
END | Moves the caret to the end of the line.
(Left Arrow) | Moves the caret one character to the left.
(Right Arrow) | Moves the caret one character to the right.
(Up Arrow) | Moves the caret one line up.
(Down Arrow) | Moves the caret one line down.
CTRL+(Left Arrow) | Moves the caret to the beginning of the current word.
CTRL+(Right Arrow) | Moves the caret to the beginning of the next word.
CTRL+HOME | Moves the caret to start of text.
CTRL+END | Moves the caret to end of text.
CTRL + ENTER | Inserts a new page.
SHIFT + ENTER | Creates a line feed without beginning a new paragraph.
CTRL + (-) | Inserts an end-of-line hyphen.
DEL | Deletes selected text.
CTRL + X | Copies selected text to the Clipboard and deletes the selection.
CTRL + V | Copies selected text to the clipboard.
CTRL + Z | Undos the last action.
CTRL + Y | Restores the last action.
CTRL + SHIFT + (Spacebar) | Inserts a non-breaking space.
CTRL +(Backspace) | Deletes the previous word.
SHIFT +(Backspace) | Deletes the previous word.
CTRL + SHIFT + ENTER | Inserts a page column break.

Pressing a key while SHIFT is pressed extends the current selection to the new caret position.


Additional Mouse and Keyboard Assignment in Tables

Key Type or Mouse Action | Reaction of Text Control
TAB | Selects the next table cell.
SHIFT + TAB | Selects the previous table cell.
CTRL + TAB | Inserts a tab character.
Click top of a column (first row) | Selects the complete table column.
Click on the selection bar (left or right margin) | Selects the complete table row.
Double-click table cell | Selects the complete table cell.


Keyboard Assignment for Hyphens

Key Type | Inserted Hyphen [Divide Position]
(-) | Hyphen, minus sign [Yes]
CTRL + (-) | Non-visible hyphen [Yes]
CTRL + SHIFT + (-) | Compound word [No]
CTRL + (-) [NUMPAD] | EN dash [Yes]
CTRL + ALT + (-) [NUMPAD] | EM dash [Yes]


Reference

Contains a complete reference of all properties, methods and events provided through the implemented TX Text Control controls and objects. All properties, methods and events are sorted in alphabetical order.

TXTextControl.TXTextControl Control

TXTextControl.TXButtonBar Control

TXTextControl.TXRulerBar Control

TXTextControl.TXStatusBar Control

TXTextControl.Style Object

TXTextControl.Styles Collection Object

TXTextControl.XMLElement Object

TXTextControl.XMLElements Collection Object

Obsolete Properties, Methods and Events


TXTextControl.TXTextControl Control

The TXTextControl control is the main control that is used to display and edit a text document. The large amout of this control's properties, methods and events are listed in alphabetical order here and are sorted by category in the Programming Categories chapter.

Syntax

TXTextControl

Properties

Property | Description
Alignment | Specifies the alignment of text in a Text Control.
AllowDrag | Gets or sets a value indicating whether the control can be a source of a Drag&Drop operation.
AllowDrop | Gets or sets a value indicating whether the control can accept data that the user drags onto it.
AllowUndo | Determines whether the undo buffer is active or not.
AutoExpand | Specifies whether the control size should expand automatically when the text insertion or format changes results in text that does not fit into the Text Control anymore.
BackColor | Returns or sets the background color of a Text Control.
BackStyle | Returns or sets a value indicating whether the background of a Text Control is transparent or opaque.
BaseLine | Specifies the baseline alignment for selected text.
BorderStyle | Returns or sets the border style for a Text Control.
BulletAttribute | This property returns or sets attributes for bulleted lists.
ButtonBarHandle | Specifies the button bar control to be used with a Text Control.
CanCopy | Informs whether a part of a Text Control's document has been selected and can be copied to the clipboard.
CanPaste | Informs whether the clipboard contains a format that can be pasted into a Text Control's document.
CanRedo | Informs whether an operation can be re-done using the Redo method.
CanUndo | Informs whether an operation can be undone using the Undo method.
CaretWidth | This property returns or sets the width of the caret in pixels.
ClipboardFormats | Returns an array of Integer values specifying all the data formats which are currently available in the clipboard and which can be pasted into a TextControl document.
ClipChildren | This property is only used for Text Controls which act as a container for other Text Controls or embedded objects.
ClipSiblings | This property determines the clipping behaviour of each of the child controls which belong to a common container control.
ColumnDistance | Sets the distance, in twips, between the columns on a page for the whole document or for a document's section.
ColumnLineColor | Returns or sets the color of a dividing line between two page columns, either for the whole document or for a certain section.
ColumnLineWidth | Returns or sets the width, in twips, of a dividing line between two page columns, either for the whole document or for a certain section.
Columns | Returns or sets the number of columns on a page for the whole document or for a document's section.
ColumnWidthsAndDistances | Returns or sets the number of columns on a page including its widths and distances for the whole document or for a document's section.
ControlChars | Specifies if control characters are visible.
CurrentInputPosition | Returns or sets an array of three values which specify the page, line and column number of the current text input position.
CurrentPages | Returns the number of pages contained in the current document.
DataText | The DataText property is used internally by Visual Basic when a Text Control is used as a bound control.
DataTextFormat | When using a Text Control as a bound control, this property specifies if the data which is exchanged with a database is text or binary data.
Device | This property returns or sets the device for which the current Text Control document is formatted.
DisplayColor | This property gets or sets the display colors of a TextControl.
EditMode | Specifies whether the Text Control operates in edit mode or in one of the two read-only modes.
Enabled | Returns or sets a value that determines whether a Text Control can respond to user-generated events.
EnableSpellChecking | Gets or sets a value indicating whether spell checking is active or not.
FieldAtInputPos | Returns the field identifier of the field containing the input position.
FieldChangeable | Specifies if the contents of a marked text field can be changed by the user.
FieldCurrent | Returns or sets the identifier of the current marked text field for the Fieldxxx properties, methods and events.
FieldData | This property relates numeric or string data to a marked text field.
FieldDeleteable | Specifies whether a marked text field can be deleted by the user.
FieldEditAttr | This property returns or sets attributes for advanced editing inside marked text fields.
FieldEnd | Returns the end position of a marked text field.
FieldLinkTargetMarkers | Gets or sets a value indicating that markers for hypertext targets are shown or not.
FieldPosX | Returns the horizontal position of a marked text field.
FieldPosY | Returns the vertical position of a marked text field.
FieldStart | Specifies the start position of a marked text field.
FieldText | Returns or sets the text which is contained within a marked text field.
FieldType | This property sets or returns the type of a marked text field.
FieldTypeData | This property sets or returns the data that belongs to a marked text field of a special type.
FontBold | Returns or sets the bold font style.
FontItalic | Returns or sets the italic font style.
FontName | Returns or sets the font used to display text.
FontSettings | Determines which kind of fonts can be used in a document.
FontSize | Returns or sets a value that specifies the size of the font used to display text.
FontStrikethru | Returns or sets the strike thru font style.
FontUnderline | Returns or sets the underline font style.
FontUnderlineStyle | This property determines styles for the FontUnderline property.
ForeColor | Returns or sets the color used to display text in a Text Control.
FormatSelection | Specifies whether character and paragraph formatting properties apply to the whole text or to a particular selection only.
FrameColor | Returns or sets the background color for selected paragraphs.
FrameDistance | Returns or sets the distance between text and paragraph frame for the currently selected paragraph(s).
FrameLineColor | Returns or sets the color for the frame lines of selected paragraphs.
FrameLineWidth | Specifies the line widths of the currently selected paragraphs' frames.
FrameStyle | Returns or sets the style of the currently selected paragraphs' frames.
HeaderFooter | This property determines which kind of headers and/or footers the document or a section contains.
HeaderFooterAtInputPos | Returns which header or footer owns the current text input position.
HeaderFooterConnectedToPrevious | This property returns or sets a value specifying whether a header or footer is connected with the header or footer of the previous section.
HeaderFooterPosition | This property specifies the position of a header or footer.
HeaderFooterStyle | This property determines how headers and footers can be activated and how activated headers and footers appear on the screen.
HideSelection | Specifies whether a text selection is hidden when the Text Control looses the input focus.
hWnd | Returns a handle to a Text Control.
ImageDisplayMode | Provides several modes to set the way in which images are displayed or refreshed.
ImageExportCompressionQuality | Determines a value between 1 and 100, which is the quality of a lossy data compression used, if the image is saved.
ImageExportFilename | Determines the file name of an image used if a document is saved.
ImageExportFilters | This property returns a string which specifies the available filters for exporting images.
ImageExportFormat | Determines the format used if an image is saved.
ImageExportMaxResolution | Determines the maximum resolution in dots per inch used, if the image is saved.
ImageFilename | Determines the image file name of an inserted image.
ImageFilters | This property returns a string which specifies the available image filters.
ImageSaveMode | Determines whether the image is stored through its data or through its file reference.
IndentB | Returns or sets an additional bottom distance (in twips) for a paragraph or a selected range of paragraphs.
IndentFL | Returns or sets an additional left indent (in twips) for the first line of a paragraph or a selected range of paragraphs.
IndentL | Returns or sets the left indent (in twips) for a paragraph or a selected range of paragraphs.
IndentR | Returns or sets the right indent (in twips) for a paragraph or a selected range of paragraphs.
IndentT | Returns or sets an additional top distance (in twips) for a paragraph or a selected range of paragraphs.
InsertionMode | Specifies whether text is inserted or overwrites existing text.
Justification | Gets or sets the kind of justification in documents containing Arabic or Hebrew characters.
KeepLinesTogether | Gets or sets a value indicating whether a page break is allowed within a paragraph.
KeepWithNext | If this property is set to true for a paragraph, it is displayed on the same page as its following paragraph.
Language | Determines the language in which Text Control displays dialog boxes and error messages.
LineSpacing | Specifies the line spacing for the currently selected paragraphs as a percentage of the font size.
LineSpacingT | Specifies the line spacing for the currently selected paragraphs in twips.
ListType | Returns or sets a list type for a paragraph or a selected range of paragraphs.
LoadSaveAttribute | This property enables an application to specify several attributes that can be used in combination with the Load and Save methods for the following situations: 1.
Locale | Specifies a language for the selected text.
LockWindowUpdate | Disables or reenables redrawing.
MisspelledWordAtInputPos | Gets the number of the misspelled word at the current text input position.
MisspelledWordLength | Gets the length of the misspelled word with the specified number.
MisspelledWords | Gets the current number of misspelled words.
MisspelledWordStart | Gets the zero-based position of the misspelled word with the specified number.
MousePointer | Returns or sets a value indicating the type of mouse pointer displayed when the mouse is over a particular part of a Text Control at run time.
NumberingAttribute | This property returns or sets attributes for numbered lists.
ObjectCurrent | Returns or sets the current object for setting properties of images, text frames or OLE objects.
ObjectDistance | Specifies the distance (in twips) between an image, text frame or OLE object and the text that flows around it.
ObjectHeight | Returns or sets the natural height, in twips, of an image, text frame or OLE object.
ObjectInsertionMode | Gets or sets an image's, text frame's or OLE object's formatting behaviour.
ObjectItem | Returns a reference to an OLE object.
ObjectName | Defines a name for an image, text frame or OLE object.
ObjectPosX | Gets or sets the imags's, text frame's or OLE object's horizontal position, in twips.
ObjectPosY | Gets or sets the image's, text frame's or OLE object's vertical position, in twips.
ObjectScaleX | Specifies the object's horizontal scaling factor as a percentage.
ObjectScaleY | Specifies the object's vertical scaling factor as a percentage.
ObjectSizeMode | Specifies whether an inserted image, text frame or OLE object can be moved or resized at run time.
ObjectTextflow | Gets or sets a value in which way text flows around an image, text frame or OLE object.
ObjectTransparency | Specifies the object's transparency.
ObjectUserId | Defines a user-defined identifier for an image, text frame or OLE object.
ObjectWidth | Returns or sets the natural width, in twips, of an image, text frame or OLE object.
PageBorderAttribute | This property returns or sets page border attributes for the whole document or for a document's section.
PageBreakBefore | If this property is set to true for a paragraph, it is always displayed on top of a page.
PageCount | Returns the number of pages, the document contains.
PageHeight | Returns or sets the height of the page for the whole document or for a document's section.
PageImage | Returns an image of the specified page which can be used with the Picture property of a Form object, PictureBox control or Image control.
PageLength | Gets the number of characters of the page, including the page break character at the end of the page.
PageMarginB | Returns or sets the bottom page margin for the whole document or for a document's section.
PageMarginL | Returns or sets the left page margin for the whole document or for a document's section.
PageMarginR | Returns or sets the right page margin for the whole document or for a document's section.
PageMarginT | Returns or sets the top page margin for the whole document or for a document's section.
PageOrientation | Returns or sets the page orientation, portrait or landscape.
PageStart | Gets the number (one-based) of the page's first character.
PageViewStyle | Defines the kind of view to display the page background.
PageWidth | Returns or sets the width of the page for the whole document or for a document's section.
ParagraphCount | Returns the number of paragraphs, the document contains.
PermanentControlChars | Gets or sets a value specifying which control characters are shown permanently on the screen.
PrintColors | Specifies whether text colors are printed as colors or in black.
PrintDevice | Sets the printer device context for TextContol's built-in printing function.
PrintOffset | Determines whether Text Control starts printing exactly at the top left corner of the page, or at the printer's physical printing offset.
PrintZoom | Specifies a zoom factor for printing.
ResourceFile | Returns or sets the file name of a resource library which Text Control loads to display resources like information strings, error messages and built-in dialog boxes.
RightToLeft | Returns or sets a value specifying whether the Text Control's vertical scrollbar is at the left or right border and whether the Text Control has a right or left zoom origin.
RTFSelText | This property works much like the standard SelText property.
RulerHandle | Specifies the ruler control to be used as horizontal ruler with a Text Control.
ScrollBars | Returns or sets a value indicating whether a Text Control has horizontal or vertical scroll bars.
ScrollPosX | Specifies the position of the horizontal scroll bar in twips.
ScrollPosY | Specifies the position of the vertical scroll bar in twips.
SectionAtInputPos | Returns the number of the section containing the current text input position.
SectionBreakKind | Returns or sets the kind of the section break the section starts with.
SectionCount | Returns the number of sections, the document contains.
SectionCurrent | Returns or sets the section number for the following properties and methods: PageWidth, PageHeight, PageMarginL, PageMarginT, PageMarginR, PageMarginB, PageOrientation, HeaderFooter, HeaderFooterActivate, HeaderFooterSelect, HeaderFooterPosition, HeaderFooterConnectedToPrevious, Columns, PageBorderAttribute, ColumnDistance, ColumnLineWidth, ColumnLineColor, ColumnWidthsAndDistances, SectionRestartPageNumbering, and SectionBreakKind.
SectionLength | Gets the number of characters in the section.
SectionRestartPageNumbering | Returns or sets a value specifying whether page numbering is restarted at the beginning of a document section.
SectionStart | Gets the number (one-based) of the section's first character.
SelectionViewMode | Specifies whether text selections are displayed with a transparent bitmap or through inverting the text.
SelLength | Returns or sets the number of characters selected.
SelStart | Returns or sets the starting point of text selected or indicates the position of the insertion point if no text is selected.
SelText | Returns or sets the string containing the currently selected text.
SizeMode | Specifies whether the Text Control can be moved or resized at run time.
StatusBarHandle | Specifies the status bar control to be used with a Text Control.
StyleCurrent | Returns or sets the formatting style at the current input position or, if text is selected, changes all styles of the selected text to the specified style.
Styles | Returns a collection of all formatting styles in a document.
SupportedFonts | This property returns a string specifying the names of all available fonts.
TabCurrent | Specifies the current tab number for the properties TabPos and TabType.
TabKey | Determines if the keyboard's tab key moves the input focus to the next control or to insert tabulators in the Text Control's text.
TableAtInputPos | Returns the table identifier of the table containing the input position.
TableCanChangeAttr | This property provides information about whether the attributes of all the selected table cells can be altered.
TableCanDeleteColumn | This property provides information about whether table columns can be deleted.
TableCanDeleteLines | This property provides information about whether table lines can be deleted.
TableCanInsert | This property provides information about whether a table can be inserted.
TableCanInsertColumn | This property provides information about whether a table column can be inserted.
TableCanInsertLines | This property provides information about whether table lines can be inserted.
TableCanMergeCells | This property provides information about whether table cells can be merged.
TableCanSplit | Checks whether a table can be split.
TableCanSplitCells | This property provides information about whether table cells can be split.
TableCellAttribute | Returns or sets attributes of a table cell.
TableCellData | Returns or sets a string associated with the specified table cell.
TableCellLength | Returns the number of characters in a table cell.
TableCellStart | Returns the character index (one-based) of the first character in a table cell.
TableCellText | Returns or sets the text of a table cell.
TableColAtInputPos | Returns the number of the current input column in a table.
TableColumns | Informs about the number of columns a specified table contains.
TableGridLines | This property determines whether or not grid lines in tables are visible.
TableNestedLevel | Gets the nested level for the specified table.
TableRowAtInputPos | Returns the number of the current input row in a table.
TableRows | Informs about the number of rows a specified table contains.
TabPos | Determines the position, in twips, of a certain tab.
TabType | Determines the type of a certain tab.
Text | Returns or sets the complete text of a Text Control.
TextBkColor | Returns or sets the background color for selected text.
TextDirection | Specifies the writing direction.
TextFrameBackColor | Returns or sets the background color of a text frame.
TextFrameBorderWidth | Specifies the width, in twips, of a text frame's border line.
TextFrameInternalMargin | Specifies the distance (in twips) between a text frame's border line and the text.
TextFrameMarkerLines | This property determines whether or not marker lines for text frames are visible.
VerticalRulerHandle | Specifies the ruler control to be used as vertical ruler with a Text Control.
ViewMode | Returns or sets the mode in which Text Control displays its text contents.
WidowOrphanLines | Gets or sets the number of lines for widow/orphan control.
WordWrapMode | This property returns or sets the mode how Text Control handles word wrapping in lines without space or other word breaking characters.
XMLEditMode | Specifies whether Text Control operates in an edit mode that validates the XML document according to the document's DTD.
XMLElements | Returns a collection of all XML elements with the same tag name.
ZoomFactor | Specifies the zoom factor for a Text Control.

Methods

Method | Description
Append | Appends text in a certain format from a file and inserts it at the end of the current document.
AppendFromMemory | Appends text in a certain format from a buffer and inserts it at the end of the current document.
ChangeTextDirection | Changes the text direction of all selected paragraphs.
Clip | Performs Text Control clipboard actions.
DecreaseIndent | Decreases the left indent of all paragraphs contained in the current text selection.
EnableAutomationServer | Enables a Text Control to work as an automation server.
EndUndoAction | Defines the end of an undo action.
FieldDelete | Deletes the marked text field specified by the FieldCurrent property, or changes it to simple text.
FieldGoto | Sets the current input position to the beginning of the specified marked text field and scrolls the text so that this position is at the top of the control's visible text.
FieldInsert | Inserts a new marked text field at the current caret position.
FieldNext | This method returns the identifier of the marked text field that follows the specified field in the Text Control's current text.
FieldSetInputPos | If the current text input position is a position at the beginning or at the end of a marked text field with a doubled input position, this method can be used to define whether the position is inside or outside the field.
Find | Searches the text in a Text Control for a given string.
FindReplace | Displays a 'Find' or 'Replace' dialog box.
FontDialog | Invokes the Text Control's built-in font dialog box and, after the user has closed the dialog box, specifies whether he has changed something.
GetBaseLinePos | Returns the baseline position of the specified line.
GetCaretRect | Returns the rectangular area covered by the caret which indicates the current text input position.
GetCharFromLine | Returns the position of a line's first character.
GetCharRect | Returns the rectangular area covered by a certain character.
GetLineCount | Returns the number of text lines in a Text Control.
GetLineFromChar | Returns the index of the line which contains the character with the specified character position.
GetLineFromPoint | Returns the index of the line which contains a given point.
GetLineRect | Returns the rectangular area covered by a line of text.
GetTextExtent | Returns the extension of the complete text in twips.
GrowFont | Increases the font size of each font contained in the current text selection.
HeaderFooterActivate | Activates or deactivates a header or footer.
HeaderFooterSelect | This method determines whether a certain Text Control property or method manipulates a header or a footer or the main text.
ImageInsert | This method inserts a new image anchored to a paragraph.
ImageInsertAsChar | This method inserts a new image which is then handled like a single character in the text.
ImageInsertFixed | This method inserts a new image at a fixed geometrical position.
IncreaseIndent | Increases the left indent of all paragraphs contained in the current text selection.
InputPosFromPoint | Returns the text input position belonging to a certain geometric position.
InsertSymbolDialog | Opens a modeless dialog box which can be used to insert symbol characters.
ListAttrDialog | Invokes the Text Control's built-in dialog box for setting attributes of bulleted and numbered lists.
Load | Loads text in a certain format from a file and inserts it into the Text Control.
LoadFromMemory | Loads text in a certain format from a buffer and inserts it into the Text Control.
LocaleDialog | Invokes the Text Control's built-in language dialog box and, after the user has closed the dialog box, specifies whether he has changed something.
MisspelledWordDelete | Removes the specified misspelled word from a Text Control document.
ObjectAttrDialog | This method invokes the built-in dialog box for setting attributes of images, text frames and OLE objects.
ObjectChangeZOrder | Changes the z-order of an image, text frame or OLE object.
ObjectDelete | This method deletes an image, text frame or OLE object.
ObjectGetFromName | Looks for the object with the specified name.
ObjectGetFromUserId | Looks for the object with the specified user identifier.
ObjectGetSelected | This method returns the identifier of the currently selected object.
ObjectInsert | This method inserts a new OLE object or other control anchored to a paragraph.
ObjectInsertAsChar | This method inserts a new OLE object or other control which is then handled like a single character in the text.
ObjectInsertFixed | This method inserts a new OLE object or other control at a fixed geometrical position.
ObjectNext | This method returns the identifier of the object that follows the specified object in a Text Control's internal list of objects.
PageNumberDialog | This method opens a built-in dialog box to set formatting attributes for the specified pagenumber field.
PageSelect | This method can be used to select the specified page.
ParagraphDialog | Invokes the Text Control's built-in paragraph attributes dialog box and, after the user has closed the dialog box, specifies whether he has changed something.
ParagraphSelect | This method can be used to select the specified paragraph.
Paste | Replaces the current selection in the Text Control with the contents of the Clipboard.
PrintDialog | Opens the system printing dialog and prints a Text Control document as specified through the dialog.
PrintDoc | Prints a Text Control document or a part of a Text Control document on the default printer.
PrintPage | Prints a page of text on the default printer.
Redo | This method can be used to redo the last Text Control operation.
Refresh | This method forces a complete repaint of a Text Control.
ResetContents | Deletes the complete contents of a Text Control including tables, objects, marked text fields and headers and footers.
Save | Saves data in a file with a specified format.
SaveToMemory | Returns a one-dimensional byte array containing text data in a specified format.
SaveToMemoryBuffer | Returns a buffer containing text data in a specified format.
SectionFormatDialog | This method invokes the built-in dialog box to set page settings and to design the headers and footers either for the whole document or for a single section.
SectionInsert | Inserts a section break at the text input position or at a specified position.
SectionSelect | This method can be used to select the specified section.
ShrinkFont | Decreases the font size of each font contained in the current text selection.
StartUndoAction | Defines the beginning of an undo action.
StyleDialog | Invokes the Text Control's built-in dialog box for creating, deleting and modifying formatting styles.
TabDialog | Invokes the Text Control's built-in dialog box for setting tabs.
TableAttrDialog | This method invokes the built-in dialog box for setting table attributes and, after the user has closed the dialog box, specifies whether he has changed something.
TableCellSelect | This method can be used to select a table cell, a table row, a table column or a complete table.
TableDelete | This method can be used to delete a complete table from the document.
TableDeleteColumn | This method deletes the currently selected table columns or the table column containing the text input position.
TableDeleteLines | This method deletes the currently selected table lines or the table line at the current input position.
TableFromSelection | This method returns the table identifier of the currently selected table.
TableGetOuter | This method returns a table's outer table.
TableGetOuterMost | This method returns a table's outermost table.
TableInsert | This method inserts a new table in the text.
TableInsertColumn | This method inserts a table column left or right of the column with the current input position.
TableInsertDialog | This method opens a built-in dialog box which offers options to define a new table.
TableInsertLines | This member function inserts table lines above or below the table line with the current input position.
TableMergeCells | This method merges all selected table cells.
TableNext | This method returns a enumaration number of the table that follows the specified table in the Text Control's current text.
TableSelectCells | This method can be used to select a rectangular part of a table defined through two table cells.
TableSplit | Splits a table below or above the current input position.
TableSplitCells | This method splits all selected table cells.
TextFrameInsert | This method inserts a new text frame anchored to a paragraph.
TextFrameInsertAsChar | This method inserts a new text frame, which is then handled as a single character in the text.
TextFrameInsertFixed | This method inserts a new text frame at a fixed geometrical position.
TextFrameSelect | This method determines whether a certain Text Control property or method manipulates a text frame or the main text.
Undo | This method can be used to undo the last Text Control operation.
Zoom | Zooms the contents of the TextControl using the specified option.

Events

Event | Description
AutoScroll | This event occurs when the cursor leaves the visible portion of a Text Control's client area whilst a text selection is being expanded with the mouse.
CaretOut | Occurs when the current input position indicated through the caret has been moved to a control that is completely out of the visible area.
CaretOutBottom | Occurs when the current input position indicated through the caret has been moved out of the visible area at the bottom.
CaretOutLeft | Occurs when the current input position indicated through the caret has been moved out of the visible area at the left side.
CaretOutRight | Occurs when the current input position indicated through the caret has been moved out of the visible area at the right side.
CaretOutTop | Occurs when the current input position indicated through the caret has been moved out of the visible area at the top.
Change | Indicates that the contents of a Text Control have changed.
CharFormatChange | Occurs when the formatting attributes of the selected characters have been changed.
Click | Occurs when the user presses and then releases a mouse button over a Text Control.
ConnectTools | MS Access only: Occurs after all Text Controls, Rulers, Button Bars and Status Bars have been created and are ready to be connected.
ContextMenuOpening | Occurs before a built-in context menu is opened.
DblClick | Occurs when the user presses and releases a mouse button and then presses and releases it again over a Text Control.
Error | Occurs when the Text Control reports an error.
FieldChanged | Occurs when the text of a marked text field has been changed.
FieldClicked | Occurs when a marked text field has been clicked on.
FieldCreated | Occurs when a marked text field has been pasted from the clipboard.
FieldDblClicked | Occurs when a marked text field has been double-clicked on.
FieldDeleted | Occurs when a marked text field has been deleted.
FieldEntered | Occurs when the current input position, indicated by the caret, has been moved to a position that belongs to a marked text field.
FieldLeft | Occurs when the current input position indicated by the caret has been moved to a position that does not belong to the marked text field at the previous input position.
FieldLinkClicked | Occurs when a marked text field has been clicked on that represents the source of a hypertext link.
FieldSetCursor | Occurs when the cursor is moved over a marked text field.
HeaderFooterActivated | Occurs when a header or footer has been activated.
HeaderFooterDeactivated | Occurs when a header or footer has been deactivated.
HExpand | Occurs when the Text Control has changed its window size horizontally.
HScroll | Occurs when the horizontal scroll position has been changed.
KeyDown | Occurs when the user presses a key while the Text Control has the input focus.
KeyPress | Occurs when the user presses and releases an ANSI key while the Text Control has the input focus.
KeyStateChange | Occurs when the character insertion mode or when the state of the NUMLOCK or CAPSLOCK key has been changed.
KeyUp | Occurs when the user releases a key while the Text Control has the input focus.
MouseDown | Occurs when the user presses a mouse button.
MouseMove | Occurs when the user moves the mouse.
MouseUp | Occurs when the user releases a mouse button.
Move | Occurs when a Text Control has been moved with the mouse.
ObjectClicked | Occurs when an object has been clicked on.
ObjectCreated | This event specifies that a new object has been created.
ObjectDblClicked | Occurs when an object has been double-clicked on.
ObjectDeleted | Occurs when an object has been deleted.
ObjectGetData | Occurs when a document which contains objects, is saved.
ObjectGethWnd | Occurs when a document which contains objects, is loaded.
ObjectGetZoom | Occurs when an object's zoom factor is requested.
ObjectMoved | Occurs if an image, text frame or OLE object has been moved with the built-in mouse interface.
ObjectPrint | Occurs when a document containing objects is printed.
ObjectRightClicked | Occurs when an object has been clicked on with the right mouse button.
ObjectScrollOut | Occurs when an object is scrolled out of the visible area.
ObjectSetData | Occurs when a document which contains objects, is loaded.
ObjectSetZoom | Occurs when an object's zoom factor is to be changed.
ObjectSized | Occurs if an image, text frame or OLE object has been resized with the built-in mouse interface.
PageChanged | Occurs when the text input position has been moved to another page.
PageFormatChange | Occurs when the page format settings have been changed.
ParagraphChange | Occurs when the character input position has been moved to another paragraph.
ParagraphFormatChange | Occurs when the paragraph attributes of the selected paragraphs have been changed.
PosChange | Occurs when the current character input position has been changed.
SectionChanged | Occurs when the text input position has been moved to another section.
Size | Occurs when a Text Control has been resized with the mouse.
SpellCheckText | Occurs, if the document's text has been altered and the spelling of the new text must be checked.
StyleChanged | Occurs after the character input position has been moved to a text part formatted with another style.
StyleListChanged | Occurs after one or more formatting styles have been added or removed.
TableCreated | Occurs after a new table has been created as a result of a text insertion via the clipboard.
TableDeleted | Occurs after a table has been deleted.
TableFormatChanged | Occurs after a table has been formatted with the built-in mouse-interface.
TextFrameActivated | Occurs when a text frame has obtained the input focus.
TextFrameDeactivated | Occurs when a text frame has lost the input focus.
VExpand | Occurs when the Text Control has changed its window size vertically.
VScroll | Occurs when the vertical scroll position has been changed.
XMLInvalid | Occurs when a loaded XML document cannot be validated with the document type definition (DTD) referenced in the document.
XMLNotWellFormed | Occurs when a loaded XML document is not well-formed.
Zoomed | Occurs when the Text Control has been zoomed.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXTextControl.Alignment Property

Specifies the alignment of text in a Text Control.

Syntax

TXTextControl.Alignment [= value]
Setting | Description
0 | (Default) Text is left-aligned.
1 | Text is right-aligned.
2 | Text is centered.
3 | Text is justified.
4 | This value cannot be assigned to the property. Its purpose is to indicate that the selected text contains paragraphs which have different types of alignment.

Remarks

If the FormatSelection property has previously been set to True, changing the Alignment property affects only the currently selected paragaph. If FormatSelection has been set to False the setting applies to the entire control, in which case a value of 4 does not occur.

Data Types

Integer.

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.AllowDrag Property

Gets or sets a value indicating whether the control can be a source of a Drag&Drop operation. To allow the control to accept data that the user drags onto it, the AllowDrop property must be set to true.

Introduced: 15.1.

Syntax

TXTextControl.AllowDrag

Data Types

Boolean.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.AllowDrop Property

Gets or sets a value indicating whether the control can accept data that the user drags onto it. This property allows the control to be a target for drop operations. To allow the control to be a source of a Drag&Drop operation the AllowDrag property must be set to true.

Introduced: 15.1.

Syntax

TXTextControl.AllowDrop

Data Types

Boolean.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.AllowUndo Property

Determines whether the undo buffer is active or not. If a Text Control is used for tasks like generating reports, it can be useful to deactivate the undo buffer to save time and memory. By default the undo buffer is active. When running on a server the undo buffer is deactivated by default.

Introduced: 11.0.

Syntax

TXTextControl.AllowUndo

Data Types

Boolean.

See Also

  • Undo Method
  • Redo Method
  • Programming Category: Undo


TXTextControl.TXTextControl.Append Method

Appends text in a certain format from a file and inserts it at the end of the current document.

Introduced: 22.0.

Syntax

TXTextControl.Append FileName[, Offset[, Format[, AppendSettings]]]
Parameter Description
FileName

Specifies the file to load from.
Offset

Optional. Specifies the file position from where the data is read. When not specified or set to zero the data is read from the beginning.
Format

Optional. Specifies a format identifier. When not specified Text Control assumes Text Control's internal format (3). See the Format parameter of the Load method for possible format identifiers.
AppendSettings

Optional. When omitted, the text is inserted at the last position of the last paragraph. Otherwise, it must be one of the following AppendSettingsConstants constants:

Constant | Meaning
txStartWithNewParagraph | Appends the text starting with a new paragraph.
txStartWithNewSection | Appends the text starting with a new section on a new page.

Return Value

The method returns the position in the file after the data has been loaded.

Data Types

FileName: | String
Offset: | Long
Format: | Integer
AppendSettings: | Integer
Return value: | Long

See Also

  • PDF Export
  • AppendFromMemory Method
  • Programming Category: Loading, Saving and Database Support


TXTextControl.TXTextControl.AppendFromMemory Method

Appends text in a certain format from a buffer and inserts it at the end of the current document.

Introduced: 22.0.

Syntax

TXTextControl.AppendFromMemory DataArray[, Format[, AppendSettings]]
Parameter Description
DataArray

Specifies the byte array to load from.
Format

Optional. Specifies a format identifier. When not specified Text Control assumes Text Control's internal format (3). See the Format parameter of the Load method for possible format identifiers.
AppendSettings

Optional. When omitted, the text is inserted at the last position of the last paragraph. Otherwise, it must be one of the following AppendSettingsConstants constants:

Constant | Meaning
txStartWithNewParagraph | Appends the text starting with a new paragraph.
txStartWithNewSection | Appends the text starting with a new section on a new page.

Return Value

The method returns True if the data could be appended, otherwise it returns False.

Data Types

DataArray: | One-dimensional Byte Array
Format: | Integer
AppendSettings: | Integer
Return value: | Boolean

Example

This Basic example copies the current contents of a TXTextcontrol to a buffer and appends this text at end of the document starting with a new section:

Dim data() As Byte
data = TXTextControl1.SaveToMemory(3)
TXTextControl1.AppendFromMemory data, 3, AppendSettingsConstants.txStartWithNewSection

See Also

  • PDF Export
  • Load Method
  • LoadFromMemory Method
  • Append Method
  • Programming Category: Loading, Saving and Database Support


TXTextControl.TXTextControl.AutoExpand Property

Specifies whether the control size should expand automatically when the text insertion or format changes results in text that does not fit into the Text Control anymore. This property is only available if the ViewMode property has been set to Simple Control.

Syntax

TXTextControl.AutoExpand [= boolean]
Setting | Description
True | The window size expands automatically.
False | Fixed window size.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.AutoScroll Event

This event occurs when the cursor leaves the visible portion of a Text Control's client area whilst a text selection is being expanded with the mouse. It is only sent if the cursor movement does not result in a caret movement. This happens if the cursor is moved outside the client area or if the cursor is moved over parts which are not covered with text below the last line. In all cases where the cursor movement results in a caret movement, the Text Control sends CaretOutxxx events. This event occurs only if the ViewMode property has been set to Simple Control.

Syntax

AutoScroll( )

See Also

  • CaretOut Event
  • Programming Category: Scrolling


TXTextControl.TXTextControl.BackColor Property

Returns or sets the background color of a Text Control. Text Control uses the Microsoft Windows operating enviroment red-green-blue (RGB) color scheme.

Syntax

TXTextControl.BackColor [= value]
Setting | Description
RGB colors | The valid range for a RGB color is 0 to &HFFFFFF. The high byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively. The red, green, and blue components are each represented by a number between 0 and 255 (&HFF).
System colors | Colors specified by the system color constants. If the high byte isn't 0, Text Control uses the system colors, as defined in the user's Control Panel settings.

Data Types

Long.

See Also

  • ForeColor Property
  • Programming Category: Control Settings


TXTextControl.TXTextControl.BackStyle Property

Returns or sets a value indicating whether the background of a Text Control is transparent or opaque. This property is only available if the ViewMode property has been set to Simple Control.

Syntax

TXTextControl.BackStyle [= value]
Setting | Description
0 - Transparent | The Text Control has a transparent background.
1 - Opaque | (Default) The control's BackColor property setting fills the background.

Remarks

A transparent background is only possible when the control's container does not clip its controls. The most containers have a property to enable or disable clipping. For example a Visual Basic form has a ClipControls property.

Data Types

Integer.

See Also

  • BackColor Property
  • Programming Category: Control Settings


TXTextControl.TXTextControl.BaseLine Property

Specifies the baseline alignment for selected text. A negative value is used to specify a subscript offset, a positive value for superscript. Text Control limits the baseline alignment to 960 twips in both directions.

Syntax

TXTextControl.BaseLine [= value]

Data Types

Integer.

See Also

  • FormatSelection Property
  • Programming Category: Character Formatting


TXTextControl.TXTextControl.BorderStyle Property

Returns or sets the border style for a Text Control.

Syntax

TXTextControl.BorderStyle [= value]
Setting | Description
0 - None | The Text Control has no border.
1 - Fixed Single | (Default) The Text Control has a fixed border.

Data Types

Integer.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.BulletAttribute Property

This property returns or sets attributes for bulleted lists. A new attribute set with this property has only effect when the ListType Method property is used the next time.

Syntax

TXTextControl.BulletAttribute(Attribute) [= value]
Parameter | Description
Attribute | Determines the attribute that is to be changed or returned. Possible values are listed in Constants.

Constants

Valid values for the Attribute parameter are:

Constant Description
txBulletChar (0)

Specifies the character code of the bullet character. This value must be the code of a character in the Unicode character set.
txBulletFormatChar (1)

Specifies the code of the character that defines the formatting of the gap between the bullet character and the following text. Possible codes are:

Code | Meaning
0 | The text immediately follows the bullet character.
9 | The text is displayed at the next tabulator position.
32 | The text follows the bullet character seperated with a space character.
txBulletLevel (2)

Specifies the level of the bulleted list. The topmost level has the number one, the maximum possible level is 10.
txBulletPos (3)

Defines the position of the bullet character in twips.
txBulletSize (4)

Defines the font size of the bullet character in twips. If this attribute is -1, Text Control displays the bullet character with the font size of the following text.
txBulletTextPos (5)

Defines, in twips, the position of the text that follows the bullet character.
txBulletFont (6)

Defines the name of the font which is used to display the bullet character.

Data Types

txBulletChar | Integer
txBulletFormatChar | Integer
txBulletLevel | Integer
txBulletPos | Integer
txBulletSize | Integer
txBulletTextPos | Integer
txBulletFont | String

Limitations

Run time only.

See Also

  • ListAttrDialog Method
  • ListType Property
  • NumberingAttribute Property
  • Programming Category: Bullets and Numbered Lists


TXTextControl.TXTextControl.ButtonBarHandle Property

Specifies the button bar control to be used with a Text Control.

Syntax

TXTextControl.ButtonBarHandle [= ButtonBar.hWnd]

Remarks

The Button Bar, like the Status Bar and the Ruler, is one of the additional controls which are contained in the Text Control OCX file.

Data Types

Handle.

Limitations

Run time only.

See Also

  • RulerHandle Property
  • VerticalRulerHandle Property
  • StatusBarHandle Property
  • Programming Category: Tool Bars


TXTextControl.TXTextControl.CanCopy Property

Informs whether a part of a Text Control's document has been selected and can be copied to the clipboard.

Syntax

TXTextControl.CanCopy

Data Types

Boolean.

Limitations

Read only, run time only.

See Also

  • CanPaste Property
  • Clip Method
  • Programming Category: Clipboard Operations


TXTextControl.TXTextControl.CanPaste Property

Informs whether the clipboard contains a format that can be pasted into a Text Control's document.

Syntax

TXTextControl.CanPaste

Data Types

Boolean.

Limitations

Read only, run time only.

See Also

  • CanCopy Property
  • Clip Method
  • Programming Category: Clipboard Operations


TXTextControl.TXTextControl.CanRedo Property

Informs whether an operation can be re-done using the Redo method.

Syntax

TXTextControl.CanRedo
Setting | Description
0 | Nothing to redo.
10 | Redo Insert Text
11 | Redo Delete Text
12 | Redo Format Text
15 | Redo Insert Style
16 | Redo Delete Style
17 | Redo Style Attributes
18 | Redo Style
19 | Redo Insert Image
20 | Redo Delete Image
21 | Redo Image Attributes
22 | Redo Table Attributes
23 | Redo Insert Table
24 | Redo Delete Table Column
25 | Redo Insert Table Column
26 | Redo Delete Table Rows
27 | Redo Insert Table Rows
28 | Redo Character Formatting
29 | Redo Paragraph Formatting
30 | Redo Bullets and Numbering
31 | Redo Text Field Attributes
32 | Redo Insert Text Field
33 | Redo Delete Text Field
34 | Redo Replace
35 | Redo Insert Text Frame
36 | Redo Delete Text Frame
37 | Redo Text Frame Attributes
38 | Redo Edit Text Frame
39 | Redo Insert Object
40 | Redo Delete Object
41 | Redo Object Attributes

Data Types

Integer.

Limitations

Read only, Runtime only.

See Also

  • CanUndo Property
  • Undo Method
  • Redo Method
  • Programming Category: Undo


TXTextControl.TXTextControl.CanUndo Property

Informs whether an operation can be undone using the Undo method.

Syntax

TXTextControl.CanUndo
Setting | Description
0 | Nothing to undo.
1 | Undo Insert Text
2 | Undo Delete Text
3 | Undo Format Text
15 | Undo Insert Style
16 | Undo Delete Style
17 | Undo Style Attributes
18 | Undo Style
19 | Undo Insert Image
20 | Undo Delete Image
21 | Undo Image Attributes
22 | Undo Table Attributes
23 | Undo Insert Table
24 | Undo Delete Table Column
25 | Undo Insert Table Column
26 | Undo Delete Table Rows
27 | Undo Insert Table Rows
28 | Undo Character Formatting
29 | Undo Paragraph Formatting
30 | Undo Bullets and Numbering
31 | Undo Text Field Attributes
32 | Undo Insert Text Field
33 | Undo Delete Text Field
34 | Undo Replace
35 | Undo Insert Text Frame
36 | Undo Delete Text Frame
37 | Undo Text Frame Attributes
38 | Undo Edit Text Frame
39 | Undo Insert Object
40 | Undo Delete Object
41 | Undo Object Attributes
42 | Undo Page Attributes
43 | Undo Insert Section Break
44 | Undo Insert Header/Footer
45 | Undo Delete Header/Footer
46 | Undo Edit Header/Footer

Data Types

Integer.

Limitations

Read only, Runtime only.

See Also

  • CanRedo Property
  • Undo Method
  • Redo Method
  • Programming Category: Undo


TXTextControl.TXTextControl.CaretOut Event

Occurs when the current input position indicated through the caret has been moved to a control that is completely out of the visible area. This event occurs only if the ViewMode property has been set to Simple Control.

Syntax

CaretOut( )

See Also

  • Programming Category: Scrolling


TXTextControl.TXTextControl.CaretOutBottom Event

Occurs when the current input position indicated through the caret has been moved out of the visible area at the bottom. This event occurs only if the ViewMode property has been set to Simple Control.

Syntax

CaretOutBottom( )

See Also

  • Programming Category: Scrolling


TXTextControl.TXTextControl.CaretOutLeft Event

Occurs when the current input position indicated through the caret has been moved out of the visible area at the left side. This event occurs only if the ViewMode property has been set to Simple Control.

Syntax

CaretOutLeft( )

See Also

  • Programming Category: Scrolling


TXTextControl.TXTextControl.CaretOutRight Event

Occurs when the current input position indicated through the caret has been moved out of the visible area at the right side. This event occurs only if the ViewMode property has been set to Simple Control.

Syntax

CaretOutRight( )

See Also

  • Programming Category: Scrolling


TXTextControl.TXTextControl.CaretOutTop Event

Occurs when the current input position indicated through the caret has been moved out of the visible area at the top. This event occurs only if the ViewMode property has been set to Simple Control.

Syntax

CaretOutTop( )

See Also

  • Programming Category: Scrolling


TXTextControl.TXTextControl.CaretWidth Property

This property returns or sets the width of the caret in pixels. Text Control supports different settings for the caret in marked text fields and in standard text. A width value of zero indicates the default setting which is the system-defined window-border width in standard text and 2 pixels in marked text fields. The maximum width is 255 pixels. A different caret width in marked text fields is only used if the &H4 attribute has been set with the FieldEditAttr property.

Syntax

TXTextControl.CaretWidth(Caret) [= Width]
Parameter Description
Caret

Specifies the caret. It can be one of the following settings:

Setting | Meaning
0 | Specifies the caret in standard text.
1 | Specifies the caret in marked text fields.

Data Types

Caret: | Integer
Property value: | Integer

Limitations

Run time only.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.ClipboardFormats Property

Returns an array of Integer values specifying all the data formats which are currently available in the clipboard and which can be pasted into a TextControl document. Possible values are listed below in the Constants section. The array's lowest index is 1, the upper bound can be determined with the UBound function. If there is no data format available, the size of the array is 0.

Introduced: 21.0.

Syntax

TXTextControl.ClipboardFormats

Constants

Valid values for the array members are:

Constant | Description
TXTextControlFormat (2) | Specifies formatted text in the internal TX Text Control format.
RichTextFormat (3) | Specifies RTF format (Rich Text Format).
Image (4) | Specifies an image. An image can be pasted, if it is a device dependent or a device independent bitmap, a TIFF image or a Windows metafile.
PlainText (5) | Specifies unformatted text.
OLEObject (6) | Specifies an OLE object.
TXTextControlTextframe (7) | Specifies a TX Text Control textframe including its contents. The clipbord contains also information about how the textframe is positioned in the document (inline or geometrically positioned).
TXTextControlImage (8) | Specifies an image including information about how the image is positioned in the document (inline or geometrically positioned).
HTMLFormat (9) | Specifies HTML format (Hypertext Markup Language).

Data Types

Property value: Array of Integer

Limitations

Read only, run time only.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.Change Event

Indicates that the contents of a Text Control have changed.

Syntax

Change( )

See Also

  • PDF Export
  • Programming Category: Loading, Saving and Database Support


TXTextControl.TXTextControl.ChangeTextDirection Method

Changes the text direction of all selected paragraphs. When the direction of a paragraph is changed this paragraph's alignment is toggled from left to right or from right to left. The alignment of centered and justified paragraphs is not changed. Left and right tabulators are also toggled.

Introduced: 20.0.

Syntax

TXTextControl.ChangeTextDirection Direction
Parameter Description
Direction

This parameter specifies how to change the text direction. Possible values are the following:

Constant | Description
txRightToLeft (1) | The text direction is right to left, which means that blocks of text with left to right and right to left characters are ordered from right to left.
txLeftToRight (2) | The text direction is left to right, which means that blocks of text with left to right and right to left characters are ordered from left to right.

Return Value

The method returns True, if the text direction could be changed. The method returns False, if an error has occurred.

Data Types

Direction: | Integer
Return value: | Boolean

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.CharFormatChange Event

Occurs when the formatting attributes of the selected characters have been changed. It also occurs if font settings have been changed because the Text Control has adapted fonts to a new output device.

Syntax

CharFormatChange( )

See Also

  • Programming Category: Character Formatting


TXTextControl.TXTextControl.Click Event

Occurs when the user presses and then releases a mouse button over a Text Control.

Syntax

Click( )

See Also

  • Programming Category: Text Selections and Character Input


TXTextControl.TXTextControl.Clip Method

Performs Text Control clipboard actions.

Syntax

TXTextControl.Clip Action
Parameter | Description
1 | Cuts out the selected text and copies it to the clipboard.
2 | Copies the selected text to the clipboard.
3 | Pastes text from the clipboard.
4 | Clears the selection.

Return Value

This method has no return value.

Data Types

Action Integer

Example

This Basic example copies the selected text from a Text Control named "TXTextControl1" to the clipboard when the user selects the "Edit/Copy" menu item:

Sub mnuEdit_Copy_Click ()
   TXTextControl1.Clip 2
End Sub

See Also

  • Programming Category: Clipboard Operations


TXTextControl.TXTextControl.ClipChildren Property

This property is only used for Text Controls which act as a container for other Text Controls or embedded objects. When this property is set to True, the areas occupied by the child controls are excluded from the update area.

Syntax

TXTextControl.ClipChildren [= boolean]
Setting | Description
True | Exclude areas which are occupied by child controls from the update area.
False | (Default) Update areas which are occupied by child controls.

Data Types

Boolean.

Example

See Forms2 Basic sample program.

See Also

  • ClipSiblings Property
  • Programming Category: Control Settings


TXTextControl.TXTextControl.ClipSiblings Property

This property determines the clipping behaviour of each of the child controls which belong to a common container control. It must be set to False if the program is to allow transparent Text Controls to overlap other Text Controls.

Syntax

TXTextControl.ClipSiblings [= boolean]
Setting | Description
True | (Default) Excludes those areas occupied by other child controls from the update area.
False | Updates areas which are occupied by other child controls.

Data Types

Boolean.

Example

See Forms2 Basic sample program.

See Also

  • ClipChildren Property
  • Programming Category: Control Settings


TXTextControl.TXTextControl.ColumnDistance Property

Sets the distance, in twips, between the columns on a page for the whole document or for a document's section. The SectionCurrent property determines the part of the document. This property can only be used for columns which are automatically calculated from the page width. All columns have then the same distance determined through this property. To set columns with different distances the ColumnWidthsAndDistances property must be used.

Introduced: 15.0.

Syntax

TXTextControl.ColumnDistance [= value]

Remarks

This property is write only. To get information about column distances the ColumnWidthsAndDistances property must be used.

Data Types

Integer.

Limitations

Write only, run time only.

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.ColumnLineColor Property

Returns or sets the color of a dividing line between two page columns, either for the whole document or for a certain section. The SectionCurrent property determines the part of the document. Text Control uses the Microsoft Windows operating enviroment red-green-blue (RGB) color scheme.

Introduced: 15.0.

Syntax

TXTextControl.ColumnLineColor [= value]

Remarks

The valid range for a RGB color is 0 to &HFFFFFF. The high byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively. The red, green, and blue components are each represented by a number between 0 and 255 (&HFF). The property returns &H80000000, if more than one section is specified through the SectionCurrent property and these sections have different line colors.

Data Types

Long.

Limitations

Run time only.

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.ColumnLineWidth Property

Returns or sets the width, in twips, of a dividing line between two page columns, either for the whole document or for a certain section. The SectionCurrent property determines the part of the document. If there is no line between two page columns, this property is zero.

Introduced: 15.0.

Syntax

TXTextControl.ColumnLineWidth [= value]

Remarks

The property returns -1, if more than one section is specified through the SectionCurrent property and these sections have different line widths.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.Columns Property

Returns or sets the number of columns on a page for the whole document or for a document's section. The SectionCurrent property determines the part of the document. If a new value is asigned, all columns receive the same width which is automatically calculated from the page width. To set columns with different widths and distances the ColumnWidthsAndDistances property must be used.

Introduced: 15.0.

Syntax

TXTextControl.Columns [= value]

Remarks

The property returns zero, if more than one section is specified through the SectionCurrent property and these sections have a different number of columns.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.ColumnWidthsAndDistances Property

Returns or sets the number of columns on a page including its widths and distances for the whole document or for a document's section. The SectionCurrent property determines the part of the document. The property returns or sets an array of Long values containing the widths of the columns and the widths of the distances between the columns. If n is the number of columns the size of the array must be 2n-1. The first n values are the widths of the columns and the remaining n-1 values are the distances between the columns. This property sets columns with different widths and distances. To set columns with equal widths and distances, which are automatically adapted to the page width, the Columns and the ColumnDistance property must be used.

Introduced: 15.0.

Syntax

TXTextControl.ColumnWidthsAndDistances [= Array]

Remarks

The sum of all widths must be equal or less than the text area of the page, which is the page width without the page margins. All values must be in twips.

The property returns an empty array, if more than one section is specified through the SectionCurrent property and these sections have a different number of columns or their widths and distances. If the array is empty, the LBound property returns 0 and the UBound property returns -1. The following code example checks the array before using it.

Data Types

Array of Long.

Limitations

Run time only.

Example

The following code demonstrates how the array can be checked if multiple sections have been selected:

Widths = TXTextControl1.ColumnWidthsAndDistances
lb = LBound(Widths, 1)
ub = UBound(Widths, 1)
If ub - lb + 1 > 0 Then
    For i = lb To ub
        Debug.Print Widths(i)
    Next i
End If

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.ConnectTools Event

MS Access only: Occurs after all Text Controls, Rulers, Button Bars and Status Bars have been created and are ready to be connected. This has to be done in 2 steps as shows in the example below. (The example assumes that you have created a Text Control named 'tx' and a Ruler Bar, Button Bar and Status Bar named Ruler, ButtonBar and StatusBar.)

Syntax

ConnectTools( )

Example

The following MS Access example shows the two-step process. The first step is code that must be added to the form's Load event the second step is code that must be added to this event.

Sub Form_Load ()
   Me!tx.object.RulerHandle = 1
   Me!tx.object.ButtonBarHandle = 1
   Me!tx.object.StatusBarHandle = 1
End Sub
Sub TX_ConnectTools ()
   Me!tx.object.RulerHandle = Me!Ruler.object.hWnd
   Me!tx.object.ButtonBarHandle = Me!ButtonBar.object.hWnd
   Me!tx.object.StatusBarHandle = Me!StatusBar.object.hWnd
End Sub

See Also

  • Programming Category: Tool Bars


TXTextControl.TXTextControl.ContextMenuOpening Event

Occurs before a built-in context menu is opened.

Introduced: 19.0.

Syntax

ContextMenuOpening(DocumentLocation, Cancel)
Parameter Description
DocumentLocation

Specifies the part of the document for which the menu is opened. It can be one or more of the following values:

Value | Description
&H1 | The menu context is a text selection.
&H2 | The menu context is the text input position.
&H4 | The menu context is the top page margin which contains a header.
&H8 | The menu context is the top page margin which contains no header.
&H10 | The menu context is the bottom page margin which contains a footer.
&H20 | The menu context is the bottom page margin which contains no footer.
&H40 | The menu context is the top or the bottom page margin.
&H80 | The menu context is a pagenumber field.
&H100 | The menu context is a selected frame (text frame, image, or OLE object).
&H200 | The menu context is a text selection or a text input position in a table.
&H400 | The menu context is a text selection or a text input position in a marked text field.
Cancel

When this parameter is set to TRUE, processing is aborted and no context menu is opened. It can be used to display an own menu.

Data Types

DocumentLocation: | Integer
Cancel: | Boolean

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.ControlChars Property

Specifies if control characters are visible.

Syntax

TXTextControl.ControlChars [= boolean]
Setting | Description
True | Control characters, like space or paragraph break, are visible.
False | Control characters are invisible.

Data Types

Boolean.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.Locale Property

Specifies a language for the selected text.

Introduced: 20.0.

Syntax

TXTextControl.Locale [= value]
Setting | Description
0 | The language of the selected text is not specified.
&HFFFF | Get only. The property returns &HFFFF, if the selected text contains parts with different language settings.
otherwise | A Windows Locale identifier (LCID), identifying the language of the selected text.

Remarks

If the FormatSelection property has previously been set to True, changing this property affects only the currently selected text. If FormatSelection has been set to False, the setting applies to the entire control content.

Data Type

Long.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.LocaleDialog Method

Invokes the Text Control's built-in language dialog box and, after the user has closed the dialog box, specifies whether he has changed something.

Introduced: 20.0.

Syntax

TXTextControl.LocaleDialog

Return Value

The method returns True when the user has changed the language. The method returns False, if the dialog box is left with Cancel or the language remains unchanged.

Remarks

The changes, made in the dialog box, apply to the currently selected text.

Data Types

Return value: Boolean

See Also

  • Programming Category: Control Settings
  • Programming Category: Built-in Dialog Boxes


TXTextControl.TXTextControl.CurrentInputPosition Property

Returns or sets an array of three values which specify the page, line and column number of the current text input position. These values are the same as shown in Text Control's status bar.

Syntax

TXTextControl.CurrentInputPosition [= Array]
Index | Description
0 | Specifies the current page number. The first page has the number one.
1 | Specifies the current line number. The first line has the number one.
2 | Specifies the current column number. The first column has the number one.

Data Types

Array of 3 Long.

Limitations

Run time only.

Example

The following code snippet demonstrates how to use the CurrentInputPosition property to get the current position of the caret in the document and afterwards set its position to the very beginning of the text.

 ' Get current position
  cur = TXTextControl1.CurrentInputPosition
  deb = Str(cur(0)) + "-" + Str(cur(1)) + "-" + Str(cur(2))
  MsgBox deb
  ' Set new position
  cur(0) = 1 ' page
  cur(1) = 1 ' line
  cur(2) = 0 ' col
  TXTextControl1.CurrentInputPosition = cur

See Also

  • Programming Category: Text Selections and Character Input


TXTextControl.TXTextControl.CurrentPages Property

Returns the number of pages contained in the current document.

Syntax

TXTextControl.CurrentPages

Remarks

The value of this property depends on the size of the text as well as on the settings of the PageHeight, PageWidth and PageMarginx properties.

Data Types

Long.

Limitations

Read only, run time only.

Example

See PrintPage method example.

See Also

  • PageHeight Property
  • PageWidth Property
  • PageMarginx Properties
  • PrintDevice Property
  • PrintPage Method
  • Programming Category: Printing and Print Preview


TXTextControl.TXTextControl.DataText Property

The DataText property is used internally by Visual Basic when a Text Control is used as a bound control. This property is not to be manipulated by the developer and will likely be hidden in future releases.

Syntax

See Also

  • PDF  Export
    •

  • Programming Category: Loading, Saving and Database Support
    •


TXTextControl.TXTextControl.DataTextFormat Property

When using a Text Control as a bound control, this property specifies if the data which is exchanged with a database is text or binary data.

Syntax

TXTextControl.DataTextFormat [= value]
Setting | Description
0 | Data is stored as text.
1 | Text and formatting information are stored in the internal binary format.

Data Types

Integer.

See Also

  • PDF Export
  • Programming Category: Loading, Saving and Database Support


TXTextControl.TXTextControl.DblClick Event

Occurs when the user presses and releases a mouse button and then presses and releases it again over a Text Control.

Syntax

DblClick( )

See Also

  • Programming Category: Text Selections and Character Input


TXTextControl.TXTextControl.DecreaseIndent Method

Decreases the left indent of all paragraphs contained in the current text selection. If no text is selected, this method decreases the left indent at the text input position. Left indent positions are defined through the paragraphs' tab positions and the indents of the paragraphs in front and behind the paragraph with the text input position.

Introduced: 16.0.

Syntax

TXTextControl.DecreaseIndent

Return Value

The return value is True, if at least one indent could be changed. It is False, if the minimum value has been reached.

Data Types

Return value: Boolean

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.Device Property

This property returns or sets the device for which the current Text Control document is formatted.

Syntax

TXTextControl.Device [= Device]
Setting | Description
1 | The document is formatted for the screen.
2 | (Default) The document is formatted for the standard printer.
Otherwise | A character string identifying an installed printer. This string must be in the same format as that used in the Windows system settings, for example: Postscript Printer, PSCRIPT, LPT1:

Data Types

Integer or String.

Limitations

Run time only.

See Also

  • PDF Export
  • Programming Category: Loading, Saving and Database Support


TXTextControl.TXTextControl.DisplayColor Property

This property gets or sets the display colors of a TextControl. By default the display colors depend on sytem colors. With this property all colors can be individually designed. The colors are only used when the text control's PageViewStyle property has been set to txGradientColors.

Introduced: 15.1.

Syntax

TXTextControl.DisplayColor(index) [= color]
Parameter | Description
index | Determines the index of the display element the color of which is changed. It must be a value of the TextControlColor enumeration. Possible values are listed in Constants.

Constants

Valid values for the index parameter are:

Constant | Description
txDesktopColor (0) | Gets or sets the display color for the area around the pages.
txLightShadowColor (1) | Gets or sets the display color for the shadow at the left and the top edge of the pages.
txDarkShadowColor (2) | Gets or sets the display color for the shadow at the right and the bottom edge of the pages.
txHeaderFooterLineColor (3) | Gets or sets the display color for the dividing line between headers and footers and the main text.
txHeaderFooterLabelColor (4) | Gets or sets the display color for the label showing which header or footer is activated.

Data Types

index: | Integer
Property value: | Long

Limitations

Run time only.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.EditMode Property

Specifies whether the Text Control operates in edit mode or in one of the two read-only modes.

Syntax

TXTextControl.EditMode [= value]
Setting | Description
0 - Edit | (Default) Edit mode. This mode can be used to edit and display text. The cursor is the text I-beam cursor.
1 - Read and Select | Read-only mode. This mode can be used to display and select text. The cursor is the standard arrow cursor.
2 - Read only | This mode can be used to display text only. Text input and selecting text with the mouse or the keyboard is not possible. The cursor is the standard arrow cursor.

Data Types

Integer.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.EnableAutomationServer Method

Enables a Text Control to work as an automation server.

Syntax

TXTextControl.EnableAutomationServer

Return Value

If the method was successful it returns True, otherwise it returns False.

Data Types

Return value: Boolean

See Also

  • Server Programming
  • Programming Category: Server Programming


TXTextControl.TXTextControl.Enabled Property

Returns or sets a value that determines whether a Text Control can respond to user-generated events.

Syntax

TXTextControl.Enabled [= boolean]
Setting | Description
True | (Default) Allows a Text Control to respond to events.
False | Prevents a Text Control from responding to events.

Data Types

Boolean.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.EnableSpellChecking Property

Gets or sets a value indicating whether spell checking is active or not. If spell checking is enabled, the SpellCheckText event is raised when the text of a document changes. The event handler can be used to check the text on misspelled words.

Introduced: 16.0.

Syntax

TXTextControl.EnableSpellChecking

Data Types

Boolean.

See Also

  • Programming Category: Spell Checking


TXTextControl.TXTextControl.EndUndoAction Method

Defines the end of an undo action. It can be used, if more than one property or method call is to be defined as a single undo action. All property and/or method calls between StartUndoAction and EndUndoAction define a single undo action.

Introduced: 11.0.

Syntax

TXTextControl.EndUndoAction

See Also

  • StartUndoAction Method
  • Programming Category: Undo


TXTextControl.TXTextControl.Error Event

Occurs when the Text Control reports an error.

Syntax

Error(Number, Description, Scode, Source, HelpFile, HelpContext, CancelDisplay)
Parameter | Description
Number | Is the error number.
Description | Is a corresponding error string. This string can be changed.
Scode | Is the OLE Status Code.
Source | Is the name of the module which caused the error.
HelpFile | Is the name of a help file.
HelpContext | Is the help context ID in this help file.
CancelDisplay | Can be set to True if the application wants to display its own error string. When this parameter is not set to True, the control will display a message box showing the error string.

Data Types

Number: | Integer
Description: | String
Scode: | Long
Source: | String
HelpFile: | String
HelpContext: | Long
CancelDisplay | Boolean

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.FieldAtInputPos Property

Returns the field identifier of the field containing the input position. Zero is returned when the input position is not inside a field.

Syntax

TXTextControl.FieldAtInputPos

Data Types

Integer.

Limitations

Read only, run time only.

See Also

  • Marked Text Fields
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldChangeable Property

Specifies if the contents of a marked text field can be changed by the user. The field identifier must have previously been determined with the FieldCurrent property.

Syntax

TXTextControl.FieldChangeable [= boolean]
Setting | Description
True | The text which is contained in the field can be changed.
False | The text cannot be changed.

Data Types

Boolean.

Limitations

Run time only.

See Also

  • Marked Text Fields
  • FieldDeleteable Property
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldChanged Event

Occurs when the text of a marked text field has been changed.

Syntax

FieldChanged(FieldId)
Parameter | Description
FieldId | Is the identifier of the field that has been changed.

Remarks

The value of the FieldCurrent property is updated with the value given through the FieldId parameter.

Data Types

FieldId: Integer

See Also

  • Marked Text Fields
  • FieldClicked Event
  • FieldCreated Event
  • FieldDblClicked Event
  • FieldDeleted Event
  • FieldSetCursor Event
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldClicked Event

Occurs when a marked text field has been clicked on.

Syntax

FieldClicked(FieldId)
Parameter | Description
FieldId | Is the identifier of the field that has been clicked on.

Remarks

The value of the FieldCurrent property is updated with the value given through the FieldId parameter.

Data Types

FieldId: Integer

See Also

  • Marked Text Fields
  • FieldChanged Event
  • FieldCreated Event
  • FieldDblClicked Event
  • FieldDeleted Event
  • FieldSetCursor Event
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldCreated Event

Occurs when a marked text field has been pasted from the clipboard.

Syntax

FieldCreated(FieldId)
Parameter | Description
FieldId | Is the identifier of the field that has been created.

Remarks

The value of the FieldCurrent property is updated with the value given through the FieldId parameter.

Data Types

FieldId: Integer

See Also

  • Marked Text Fields
  • FieldChanged Event
  • FieldClicked Event
  • FieldDblClicked Event
  • FieldDeleted Event
  • FieldSetCursor Event
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldCurrent Property

Returns or sets the identifier of the current marked text field for the Fieldxxx properties, methods and events.

Syntax

TXTextControl.FieldCurrent [= FieldId]

Data Types

Integer.

Limitations

Run time only.

Example

The Basic example creates a marked text field with a text content of 'New Field' and afterwards changes the text to 'Hello':

Sub Create()
   Dim FieldId As Integer
   'Create a marked text field and store its number
   TXTextControl.FieldInsert "New Field"
   FieldId = TXTextControl.FieldCurrent
   ..
   'Change the text
   TXTextControl.FieldCurrent = FieldId
   TXTextControl.FieldText = "Hello"
End Sub

See Also

  • Marked Text Fields
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldData Property

This property relates numeric or string data to a marked text field.

Syntax

TXTextControl.FieldData(FieldId) [= Data]
Parameter | Description
FieldId | Identifies the field that is to be manipulated.

Remarks

The specified data can be a long value or a character string. A long value of zero or an empty string deletes all data previously related to the specified marked text field.

Data Types

Long or String.

Limitations

Run time only.

See Also

  • Marked Text Fields
  • FieldInsert Method
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldDblClicked Event

Occurs when a marked text field has been double-clicked on.

Syntax

FieldDblClicked(FieldId)
Parameter | Description
FieldId | Is the identifier of the field that has been double-clicked on.

Remarks

The value of the FieldCurrent property is updated with the value given through the FieldId parameter.

Data Types

FieldId: Integer

See Also

  • Marked Text Fields
  • FieldChanged Event
  • FieldClicked Event
  • FieldCreated Event
  • FieldDeleted Event
  • FieldSetCursor Event
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldDelete Method

Deletes the marked text field specified by the FieldCurrent property, or changes it to simple text.

Syntax

TXTextControl.FieldDelete DeleteTotal
Parameter | Description
DeleteTotal | Specifies whether only the field or the field including its text is deleted. If this parameter is True, the marked text field including its text is deleted. If this parameter is False, the marked text field is deleted, but its text contents are preserved.

Return Value

The method returns True when the operation could be performed, otherwise it returns False.

Data Types

DeleteTotal: | Boolean
Return value: | Boolean

See Also

  • Marked Text Fields
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldDeleteable Property

Specifies whether a marked text field can be deleted by the user. The field identifier must have previously been determined with the FieldCurrent property.

Syntax

TXTextControl.FieldDeleteable [= boolean]
Setting | Description
True | The field can be deleted.
False | The field cannot be deleted.

Data Types

Boolean.

Limitations

Run time only.

See Also

  • Marked Text Fields
  • FieldChangeable Property
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldDeleted Event

Occurs when a marked text field has been deleted.

Syntax

FieldDeleted(FieldId)
Parameter | Description
FieldId | Is the identifier of the field that has been deleted.

Remarks

The value of the FieldCurrent property is set to zero.

Data Types

FieldId: Integer

See Also

  • Marked Text Fields
  • FieldChanged Event
  • FieldClicked Event
  • FieldCreated Event
  • FieldDblClicked Event
  • FieldSetCursor Event
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldEditAttr Property

This property returns or sets attributes for advanced editing inside marked text fields.

Syntax

TXTextControl.FieldEditAttr(FieldId) [= Attr]
Parameter | Description
FieldId | Identifies the field that is to be manipulated. Possible property settings are listed in Constants.

Constants

The following lists the possible property values. These values can be combined by adding the desired constant values. Changing one option does not affect the other. The default value of a newly inserted field is: &H2 + &H8 + &H20 + &H80

Constant | Description
&H1 | Implements a second character input position at the beginning and the end of the specified marked text field.
&H2 | Performs normal editing at the beginning and the end of the specified marked text field.
&H4 | Changes the width of the caret when the character input position is inside the specified marked text field.
&H8 | Uses the normal text caret when the character input position is inside the specified marked text field.
&H10 | Displays the text of the specified marked text field with a gray background when the input position is inside this field.
&H20 | Displays the text of the specified marked text field with the standard control background when the input position is inside this field.
&H40 | Enables the normal double-click processing inside marked text fields that starts a wordwise selection. The TXTextControl.FieldDblClicked is suppressed.
&H80 | Disables the normal double-click processing inside marked text fields. The TXTextControl.FieldDblClicked is enabled.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Marked Text Fields
  • FieldInsert Method
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldEnd Property

Returns the end position of a marked text field. The field identifier must have previously been determined with the FieldCurrent property.

Syntax

TXTextControl.FieldEnd

Data Types

Long.

Limitations

Read only, run time only.

See Also

  • Marked Text Fields
  • FieldStart Property
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldEntered Event

Occurs when the current input position, indicated by the caret, has been moved to a position that belongs to a marked text field.

Syntax

FieldEntered(FieldId)
Parameter | Description
FieldId | Is the identifier of the field that has been entered.

Remarks

This event that does not change the value of the FieldCurrent property.

Data Types

FieldId: Integer

See Also

  • Marked Text Fields
  • FieldLeft Event
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldGoto Method

Sets the current input position to the beginning of the specified marked text field and scrolls the text so that this position is at the top of the control's visible text.

Syntax

TXTextControl.FieldGoto FieldType, FieldIdOrName
Parameter | Description
FieldType | Specifies the type of the marked text field. See the Constants section of the FieldType property for valid values.
FieldIdOrName | Identifies the marked text field to which should be scrolled. It must be a valid field identifier. For fields of the type txFieldLinkTarget this parameter can also be the name of the field. For fields of the type txFieldTopic this parameter can also be a valid topic number.

Return Value

If the field could be found the method returns True, otherwise it returns False.

Data Types

FieldType: | Integer
FieldIdOrName: | Integer or String
Return value: | Boolean

See Also

  • Marked Text Fields
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldInsert Method

Inserts a new marked text field at the current caret position.

Syntax

TXTextControl.FieldInsert FieldText
Parameter | Description
FieldText | Specifies the text contents for the new marked text field.

Return Value

The method returns True if a field could be inserted, otherwise it returns False.

Remarks

Inserting a marked text field changes the value of the FieldCurrent property to the identifier of the newly created field.

Data Types

FieldText: | String
Return value: | Boolean

Example

See the description of the FieldCurrent property.

See Also

  • Marked Text Fields
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldLeft Event

Occurs when the current input position indicated by the caret has been moved to a position that does not belong to the marked text field at the previous input position.

Syntax

FieldLeft(FieldId)
Parameter | Description
FieldId | Is the identifier of the field that has been left.

Remarks

This event that does not change the value of the FieldCurrent property.

Data Types

FieldId: Integer

See Also

  • Marked Text Fields
  • FieldEntered Event
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldLinkClicked Event

Occurs when a marked text field has been clicked on that represents the source of a hypertext link.

Syntax

FieldLinkClicked(FieldId, FieldType, TypeData)
Parameter | Description
FieldId | Is the identifier of the field that has been clicked on.
FieldType | Is the type of the field that has been clicked on. This event occurs only for fields of the types txFieldExternalLink and txFieldInternalLink.
TypeData | Specifies a character string that is the information to where the link points. This data has either been set with the FieldTypeData property or has been created through a text filter. For fields of the type txFieldExternalLink this can be any kind of address or file name. For fields of the type txFieldInternalLink this is the name of a marked text field of the type txFieldLinkTarget.

Data Types

FieldId: | Integer
FieldType: | Integer
TypeData: | String

See Also

  • Marked Text Fields
  • FieldTypeData Property
  • Programming Category: Hypertext Links


TXTextControl.TXTextControl.FieldLinkTargetMarkers Property

Gets or sets a value indicating that markers for hypertext targets are shown or not.

Introduced: 13.0.

Syntax

TXTextControl.FieldLinkTargetMarkers [= boolean]
Setting | Description
True | Target Markers are visible.
False | (Default) Target markers are hidden.

Data Types

Boolean.

See Also

  • Marked Text Fields
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldNext Method

This method returns the identifier of the marked text field that follows the specified field in the Text Control's current text. It can be used to find the next field in the text or to enumerate all fields. In a list of linked Text Controls the search is performed in all controls.

Syntax

TXTextControl.FieldNext FieldId, FieldGroup
Parameter Description
FieldId

Specifies a field identifier. If this parameter is zero, the first field's identifier is returned.
FieldGroup

This parameter can be the sum of one or more constants used to seperate fields with certain attributes. Valid values are described in the following list. If FieldGroup is zero, the method enumerates all fields.

Value | Description
0 | Returns the identifiers of all fields.
&H1 | Returns only identifiers of fields which are both changeable and deleteable.
&H2 | Returns only identifiers of fields which are unchangeable.
&H4 | Returns only identifiers of fields which are undeleteable.
&H100 | Returns only identifiers of fields which have the type txFieldLinkTarget.
&H200 | Returns only identifiers of fields which have the type txFieldExternalLink.
&H400 | Returns only identifiers of fields which have the type txFieldInternalLink.
&H800 | Returns only identifiers of fields which have the type txFieldPageNumber.
&H1000 | Returns only identifiers of fields which have the type txFieldHighlight.
&H2000 | Returns only identifiers of fields which have the type txFieldTopic.
&H8000 | Returns only identifiers of fields which have the type txFieldMSWord.
&H10000 | Returns only identifiers of fields which have the type txFieldHighEdit.
&H20000 | Returns only identifiers of fields which have the type txFieldAllPages.

Data Types

FieldId: | Integer
FieldGroup: | Long
Return value: | Integer

See Also

  • Marked Text Fields
  • FieldChangeable Property
  • FieldDeleteable Property
  • FieldType Property
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldPosX Property

Returns the horizontal position of a marked text field. The field identifier must have previously been determined with the FieldCurrent property.

Syntax

TXTextControl.FieldPosX

Remarks

The property value is the distance in horizontal direction between the left border of the marked text field and the left border of the Text Control. It is not affected by the scrollbar positions.

Data Types

Long.

Limitations

Read only, run time only.

See Also

  • Marked Text Fields
  • FieldPosY Property
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldPosY Property

Returns the vertical position of a marked text field. The field identifier must have previously been determined with the FieldCurrent property.

Syntax

TXTextControl.FieldPosY

Remarks

The property value is the distance in vertical direction between the upper left of the marked text field and the upper left of the Text Control. It is not affected by the scrollbar positions.

Data Types

Long.

Limitations

Read only, run time only.

See Also

  • Marked Text Fields
  • FieldPosX Property
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldSetCursor Event

Occurs when the cursor is moved over a marked text field.

Syntax

FieldSetCursor(FieldId, MousePointer)
Parameter | Description
FieldId | Is the identifier of the field where the cursor is moved over.
MousePointer | When this parameter is changed Text Control uses the specified cursor whilst moving over the marked text field. When this parameter is not changed, Text Control uses its standard cursor for marked text fields (Up Arrow). For possible values see the description of the MousePointer property.

Remarks

This event that does not change the value of the FieldCurrent property.

Data Types

FieldId: | Integer
MousePointer: | Integer

See Also

  • Marked Text Fields
  • FieldChanged Event
  • FieldClicked Event
  • FieldCreated Event
  • FieldDblClicked Event
  • FieldDeleted Event
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldSetInputPos Method

If the current text input position is a position at the beginning or at the end of a marked text field with a doubled input position, this method can be used to define whether the position is inside or outside the field. The input position's character position is not changed.

Introduced: 13.0.

Syntax

TXTextControl.FieldSetInputPos FieldInputPosition
Parameter Description
FieldInputPosition

Specifies the position. It can be one of the following Constants:

Value | Description
txInsideField | The current input position is inside the field.
txOutsideField | The current input position is outside the field.
txInsideNextField | The specified position is inside the next field. This value is only possible, if there are two following fields without any character between the fields. In this case txInsideField is in the first field, txOutsideField is between the fields and txInsideNextField is in the second field.

Return Value

The return value is non-zero if the input position has been changed. It is zero if the current input position is not at the beginning or the at the end of a field or if the field has no doubled input position.

Data Types

FieldInputPosition: | Integer
Return value: | Boolean

See Also

  • Marked Text Fields
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldStart Property

Specifies the start position of a marked text field. The field identifier must have previously been determined with the FieldCurrent property.

Syntax

TXTextControl.FieldStart

Data Types

Long.

Limitations

Read only, run time only.

See Also

  • Marked Text Fields
  • FieldEnd Property
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldText Property

Returns or sets the text which is contained within a marked text field. The field identifier must have previously been determined with the FieldCurrent property.

Syntax

TXTextControl.FieldText [= string]

Data Types

String.

Limitations

Run time only.

See Also

  • Marked Text Fields
  • Programming Category: Text Fields


TXTextControl.TXTextControl.FieldType Property

This property sets or returns the type of a marked text field. The chapter Technical Articles - Marked Text Fields - Special Types of Marked Text Fields describes all the types and the data belonging to these types. Type-related data must be set with the FieldTypeData property.

Syntax

TXTextControl.FieldType(FieldId) [= FieldType]
Parameter | Description
FieldId | Identifies the field that is to be manipulated. Possible property values are listed in Constants.

Constants

The following lists the possible property values:

Constant | Description
txFieldStandard (0) | Resets a field of a special type to a standard marked text field.
txFieldExternalLink (1) | Defines the source of a hypertext link to a location outside of the document. The FieldTypeData property must be used to define where the link points to.
txFieldInternalLink (2) | Defines the source of a hypertext link to a location in the same document.The FieldTypeData property must be used to define where the link points to. It must be the name of a marked text field that has the txFieldLinkTarget type.
txFieldPageNumber (3) | This field displays the current page number. It can only be used in headers or footers. The FieldTypeData property can be used to define the starting number and its format.
txFieldLinkTarget (4) | Defines a position in a document which is the target of a hypertext link. The FieldTypeData property must be used to define the name of this field.
txFieldHighlight (5) | Defines a piece of text that can be highlighted. The FieldTypeData property must be used to define the color of the highlight.
txFieldTopic (6) | Defines a position in a document that is the beginning of a topic. The FieldTypeData property must be used to define the number of the topic.
txFieldMSWord (7) | Defines a Microsoft Word field. The FieldTypeData property must be used to define the field's type name and parameters.
txFieldHighEdit (8) | Defines a Heiler HighEdit field. The FieldTypeData property must be used to define the field's type name and parameters.
txFieldAllPages (9) | This field displays the number of pages in the document or section. It can only be used in headers and footers. The FieldTypeData property can be used to define its format.

Remarks

The types txFieldLinkTarget, txFieldPageNumber, txFieldAllPages and txFieldTopic can only be set when the marked text field has no text.

Data Types

FieldId: | Integer
Property value: | Integer

Limitations

Run time only.

See Also

  • Marked Text Fields
  • FieldInsert Method
  • FieldTypeData Property
  • FieldLinkClicked Event
  • Programming Category: Hypertext Links


TXTextControl.TXTextControl.FieldTypeData Property

This property sets or returns the data that belongs to a marked text field of a special type. The chapter Technical Articles - Marked Text Fields - Special Types of Marked Text Fields informs about all the types and the data belonging to these types.

Syntax

TXTextControl.FieldTypeData(FieldId) [= TypeData]
Parameter | Description
FieldId | Identifies the field that is to be manipulated. The specified data can be a long value or a character string depending on the type of the field. For the different field types the corresponding data are listed in the following Constants section.

Constants

The following lists the possible data for each type of field. The corresponding data type is listed in Data Types:

Constant Description
txFieldExternalLink (1)

Defines the external location to where the link points.
txFieldInternalLink (2)

Defines the location in the same document to where the link points.
txFieldPageNumber (3)

Defines the starting number and the number format. To display the number in a certain format the following constants can be added to the starting number:

Constant | Description
&H30000 | Pages are numbered with Arabic numbers (1, 2, 3, ...).
&H40000 | Pages are numbered with small letters (a, b, c, ...).
&H50000 | Pages are numbered with capital letters (A, B, C, ...).
&H60000 | Pages are numbered with Roman numbers (I, II, III, ...).
&H70000 | Pages are numbered with small Roman numbers (i, ii, iii, ...).
txFieldLinkTarget (4)

Defines the name of a target.
txFieldHighlight (5)

Defines the color of the highlight.
txFieldTopic (6)

Defines the number of the topic.
txFieldMSWord (7)

Defines the type name and parameters of a Microsoft Word field as a sequence of strings, separated through TAB (9) characters. The first string specifies the type name of the field (for example: MERGEFIELD). The following strings are the field's parameters which can be arguments and switches. Each switch begins with a backslash.
txFieldHighEdit (8)

Defines the name and parameters of the Heiler Highedit field as a sequence of strings, separated through TAB (9) characters.
txFieldAllPages (9)

Defines the number format. It can be one of the following constants:

Constant | Description
&H30000 | The number of pages is shown with an Arabic number (1, 2, 3, ...).
&H40000 | The number of pages is shown with a small letter (a, b, c, ...).
&H50000 | The number of pages is shown with a capital letter (A, B, C, ...).
&H60000 | The number of pages is shown with a Roman number (I, II, III, ...).
&H70000 | The number of pages is shown with a small Roman number (i, ii, iii, ...).

Data Types

FieldId: | Integer
txFieldExternalLink | String
txFieldInternalLink | String
txFieldPageNumber | Long
txFieldLinkTarget | String
txFieldHighlight | Long
txFieldTopic | Long
txFieldMSWord | String
txFieldHighEdit | String
txFieldAllPages | Long

Limitations

Run time only.

Example

The following example numbers pages with Roman numbers starting with number 3:

TXTextControl1.FieldTypeData(1) = 3 + &H60000

See Also

  • Marked Text Fields
  • FieldInsert Method
  • FieldLinkClicked Event
  • Programming Category: Hypertext Links


TXTextControl.TXTextControl.Find Method

Searches the text in a Text Control for a given string.

Syntax

TXTextControl.Find FindWhat[, Start[, Options]]
Parameter Description
FindWhat

Specifies the string to search for.
Start

Optional. An integer character index that determines where to begin the search. The first character of text in the control has an index of 0. When this parameter is omitted or set to -1, the search begins at the current input position.
Options

Optional. Is the sum of one or more constants used to specify optional features, as described in the following list:

Constant | Description
1 - SearchUp | Determines the direction of searches through a document. If this flag is used, the search direction is up; if the flag is not used, the search direction is down.
4 - MatchCase | Determines if a match is based on the case of the specified string as well as the text of the string.
8 - NoHighLight | Determines if a match appears highlighted in the Text Control.
16 - NoMessageBox | Suppresses the built-in message boxes which inform the user that a match could not be found.
64 - MatchWholeWord | Searches for whole words only.

Return Value

If the text searched for is found, the Find method highlights the specified text and returns the index (zero-based) of the first character highlighted. If the specified text is not found, the Find method returns -1.

Data Types

FindWhat: | String
Start: | Long
Options: | Long
Return value: | Long

See Also

  • FindReplace Method
  • Programming Category: Search and Replace


TXTextControl.TXTextControl.FindReplace Method

Displays a 'Find' or 'Replace' dialog box.

Syntax

TXTextControl.FindReplace TypeOfDialog
Parameter | Description
TypeOfDialog | If this parameter is set to 1 a 'Find' dialog box is displayed, if this parameter is set to 2, a 'Find and Replace' dialog box is displayed.

Return Value

This method has no return value.

Data Types

TypeOfDialog Integer

See Also

  • Programming Category: Search and Replace
  • Programming Category: Built-in Dialog Boxes


TXTextControl.TXTextControl.FontBold Property

Returns or sets the bold font style. At design time the property determines the style of the complete text. At runtime the property gets or sets the style of the selected text if the FormatSelection property has been set to True. If the FormatSelection property has been set to False the style setting is made for the complete text.

Syntax

TXTextControl.FontBold [= value]
Setting | Description
0 | Resets the bold font style to normal or indicates that no character is formatted with the bold font style.
1 | Sets all characters to the bold font style or indicates that all characters are formatted with the bold font style.
2 | Indicates that the selection contains a mix of bold and not bold characters. This value is only possible at runtime and when the FormatSelection property has been set to True.

Data Types

Integer.

See Also

  • FontName Property
  • FontSize Property
  • FontDialog Method
  • FormatSelection Property
  • Programming Category: Character Formatting


TXTextControl.TXTextControl.FontDialog Method

Invokes the Text Control's built-in font dialog box and, after the user has closed the dialog box, specifies whether he has changed something.

Syntax

TXTextControl.FontDialog

Return Value

The method returns True when the user has changed one or more attibutes. The method returns False when the formatting remains unchanged.

Remarks

The changes, made in the dialog box, apply to the currently selected text.

Data Types

Return value: Boolean

See Also

  • Programming Category: Character Formatting
  • Programming Category: Built-in Dialog Boxes


TXTextControl.TXTextControl.FontItalic Property

Returns or sets the italic font style. At design time the property determines the style of the complete text. At runtime the property gets or sets the style of the selected text if the FormatSelection property has been set to True. If the FormatSelection property has been set to False the style setting is made for the complete text.

Syntax

TXTextControl.FontItalic [= value]
Setting | Description
0 | Resets the italic font style to normal or indicates that no character is formatted with the italic font style.
1 | Sets all characters to the italic font style or indicates that all characters are formatted with the italic font style.
2 | Indicates that the selection contains a mix of italic and not italic characters. This value is only possible at runtime and when the FormatSelection property has been set to True.

Data Types

Integer.

See Also

  • FontName Property
  • FontSize Property
  • FontDialog Method
  • FormatSelection Property
  • Programming Category: Character Formatting


TXTextControl.TXTextControl.FontName Property

Returns or sets the font used to display text. At design time this property changes or gets the font name of the complete text. At runtime this property determines the font of the selected text when the FormatSelection property has been set to True. When the FormatSelection property has been set to False the font of the complete text is set or returned.

Syntax

TXTextControl.FontName [= string]

Remarks

The property returns an empty string if the selected text contains different fonts. This can happen only at runtime and when the FormatSelection property has been set to True.

Data Types

String.

See Also

  • FontDialog Method
  • FormatSelection Property
  • Programming Category: Character Formatting


TXTextControl.TXTextControl.FontSettings Property

Determines which kind of fonts can be used in a document.

Introduced: 15.0.

Syntax

TXTextControl.FontSettings [= value]
Setting | Description
0 - All Fonts | (Default) All fonts which are supported through the output device are allowed.
1 - Scaleable Fonts only | Allows only scaleable fonts.
2 - Embeddable Fonts only | Allows only fonts which are embeddable. Embeddable fonts may be stored in a document without violating their font embedding licensing rights. When a document with embedded fonts is opened on a system that does not have the font installed, the embedded font may be loaded for temporary use on that system. TX Text Control allows only OpenType and TrueType fonts to be embeddable.
4 - TrueType Fonts only | Allows only OpenType and TrueType fonts.

Remarks

The values listed above can be added to set more than one option.

Data Types

Integer.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.FontSize Property

Returns or sets a value that specifies the size of the font used to display text. This value is in points. At design time this property changes or gets the font size of the complete text. At runtime this property determines the font size of the selected text when the FormatSelection property has been set to True. When the FormatSelection property has been set to False the font size of the complete text is set or returned.

Syntax

TXTextControl.FontSize [= value]

Remarks

The property returns 0 if the selected text contains fonts with different sizes. This can happen only at runtime and when the FormatSelection property has been set to True.

Data Types

Integer.

See Also

  • FontDialog Method
  • FormatSelection Property
  • Programming Category: Character Formatting


TXTextControl.TXTextControl.FontStrikethru Property

Returns or sets the strike thru font style. At design time the property determines the style of the complete text. At runtime the property gets or sets the style of the selected text if the FormatSelection property has been set to True. If the FormatSelection property has been set to False the style setting is made for the complete text.

Syntax

TXTextControl.FontStrikethru [= value]
Setting | Description
0 | Resets the strike thru font style to normal or indicates that no character is formatted with the strike thru font style.
1 | Sets all characters to the strike thru font style or indicates that all characters are formatted with the strike thru font style.
2 | Indicates that the selection contains a mix of characters that have or have not the strike thru font style. This value is only possible at runtime and when the FormatSelection property has been set to True.

Data Types

Integer.

See Also

  • FontName Property
  • FontSize Property
  • FontDialog Method
  • FormatSelection Property
  • Programming Category: Character Formatting


TXTextControl.TXTextControl.FontUnderline Property

Returns or sets the underline font style. At design time the property determines the style of the complete text. At runtime the property gets or sets the style of the selected text if the FormatSelection property has been set to True. If the FormatSelection property has been set to False the style setting is made for the complete text.

Syntax

TXTextControl.FontUnderline [= value]
Setting | Description
0 | Resets the underline font style to normal or indicates that no character is formatted with the underline font style.
1 | Sets all characters to the underline font style or indicates that all characters are formatted with the underline font style.
2 | Indicates that the selection contains a mix of underlined nd not underlined characters. This value is only possible at runtime and when the FormatSelection property has been set to True.

Data Types

Integer.

See Also

  • FontName Property
  • FontSize Property
  • FontDialog Method
  • FormatSelection Property
  • Programming Category: Character Formatting


TXTextControl.TXTextControl.FontUnderlineStyle Property

This property determines styles for the FontUnderline property.

Syntax

TXTextControl.FontUnderlineStyle [= value]
Setting | Description
&H1 | Underline style is single underlined.
&H2 | Underline style is double underlined.
&H4 | Underline style is words only underlined. This value is possible only in combination with single or double underlined.
&H10 | The text contains single underlined parts.
&H20 | The text contains double underlined parts.
&H40 | The text contains parts that are underlined words only.

Remarks

The first group of values describes the underline styles. The second group are additional values that are only useful for the property return value. They inform about complex selections and are possible only when the FormatSelection property has been set to True.

Data Types

Integer.

Limitations

Run time only.

See Also

  • FontUnderline Property
  • FormatSelection Property
  • Programming Category: Character Formatting


TXTextControl.TXTextControl.ForeColor Property

Returns or sets the color used to display text in a Text Control. Text Control uses the Microsoft Windows operating enviroment red-green-blue (RGB) color scheme. At design time this property changes or gets the text color of the complete text. At runtime this property determines the color of the selected text when the FormatSelection property has been set to True. When the FormatSelection property has been set to False the text color of the complete text is set or returned.

Syntax

TXTextControl.ForeColor [= value]
Setting | Description
RGB colors | The valid range for a RGB color is 0 to &HFFFFFF. The high byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively. The red, green, and blue components are each represented by a number between 0 and 255 (&HFF).
System colors | Colors specified by the system color constants. If the high byte isn't 0, Text Control uses the system colors, as defined in the user's Control Panel settings.

Data Types

Long.

See Also

  • FormatSelection Property
  • BackColor Property
  • Programming Category: Character Formatting


TXTextControl.TXTextControl.FormatSelection Property

Specifies whether character and paragraph formatting properties apply to the whole text or to a particular selection only.

Syntax

TXTextControl.FormatSelection [= boolean]
Setting | Description
True | The formatting properties only apply to selected text. This mode works only at run time, because at design time it is not possible to select text.
False | (Default) The formatting properties apply to the complete text.

Remarks

The properties which are affected are Alignment, BaseLine, FontBold, FontItalic, FontName, FontSize, FontStrikethru, FontUnderline, FontUnderlineStyle, LineSpacing, LineSpacingT, ForeColor, TextBkColor, TextDirection, Justification.

Data Types

Boolean.

See Also

  • Programming Category: Text Selections and Character Input


TXTextControl.TXTextControl.FrameColor Property

Returns or sets the background color for selected paragraphs. Text Control uses the Microsoft Windows operating enviroment red-green-blue (RGB) color scheme.

Introduced: 24.0.

Syntax

TXTextControl.FrameColor [= value]

Remarks

The FrameColor property applies only to the currently selected paragraphs. The BackColor property can be used to set the window background color. The valid range for a RGB color is 0 to &HFFFFFF. The high byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively. The red, green, and blue components are each represented by a number between 0 and 255 (&HFF).

Data Types

Long.

See Also

  • FormatSelection Property
  • BackColor Property
  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.FrameDistance Property

Returns or sets the distance between text and paragraph frame for the currently selected paragraph(s).

Syntax

TXTextControl.FrameDistance [= value]

Remarks

The property returns -1 if the user selects two or more paragraphs which have different frame distance settings.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.FrameLineColor Property

Returns or sets the color for the frame lines of selected paragraphs. Text Control uses the Microsoft Windows operating enviroment red-green-blue (RGB) color scheme.

Introduced: 24.0.

Syntax

TXTextControl.FrameLineColor [= value]

Remarks

The FrameLineColor property applies only to the currently selected paragraphs. The FrameStyle property can be used to define a paragraph's frame lines. The valid range for a RGB color is 0 to &HFFFFFF. The high byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively. The red, green, and blue components are each represented by a number between 0 and 255 (&HFF).

Data Types

Long.

See Also

  • FormatSelection Property
  • FrameStyle Property
  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.FrameLineWidth Property

Specifies the line widths of the currently selected paragraphs' frames.

Syntax

TXTextControl.FrameLineWidth [= value]

Remarks

The property returns 0 if the user selects two or more paragraphs which have different line width settings.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.FrameStyle Property

Returns or sets the style of the currently selected paragraphs' frames.

Syntax

TXTextControl.FrameStyle [= value]
Setting | Description
&H1 | Draws a left frame line.
&H2 | Draws a right frame line.
&H4 | Draws a top frame line.
&H8 | Draws a bottom frame line.
&H10 | Draws a vertical line at each tab position.
&H20 | Draws a single line.
&H40 | Draws a doubled line.
&H80 | Connects two sequential boxes to form a single box.
&H100 | Resets an existing left line.
&H200 | Resets an existing right line.
&H400 | Resets an existing top line.
&H800 | Resets an existing bottom line.
&H1000 | Resets existing tabulator lines.
&H8000 | Resets the connection of two sequential boxes.

Remarks

The property returns -1 if the user selects two or more paragraphs which have different frame style settings.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.GetBaseLinePos Method

Returns the baseline position of the specified line. The dimensions are given in twips with an origin at the upper left corner of the text. The relationship between the upper left corner of the text and the upper left corner of the control can be obtained with the ScrollPosY property.

Syntax

TXTextControl.GetBaseLinePos Line
Parameter | Description
Line | Specifies the index of the line whose baseline position is returned. The index of the first line is zero.

Return Value

The method returns the requested baseline position in twips. It is zero if an error has occurred or if the specified line does not exist.

Data Types

Line: | Long
Return value: | Long

See Also

  • ScrollPosY Property
  • GetLineRect Method
  • Programming Category: Line and Character Operations


TXTextControl.TXTextControl.GetCaretRect Method

Returns the rectangular area covered by the caret which indicates the current text input position. The dimensions are given in pixels with an origin at the top left corner of the control.

Introduced: 22.0.

Syntax

TXTextControl.GetCaretRect

Return Value

The method returns an array of 4 long values specifying the left, top, right and bottom border of the requested rectangle in pixels.

Data Types

Return value: Array of 4 Long

See Also

  • Programming Category: Text Selections and Character Input


TXTextControl.TXTextControl.GetCharFromLine Method

Returns the position of a line's first character. The first character's position is the number of characters from the beginning of the text to the beginning of the specified line. The first character's position of the first line is zero.

Syntax

TXTextControl.GetCharFromLine Line
Parameter | Description
Line | Specifies the index of the line whose character position is returned. The index of the first line is zero.

Return Value

The method returns the requested character position. It is -1 if an error has occurred or if the specified line does not exist.

Data Types

Line: | Long
Return value: | Long

See Also

  • GetLineCount Method
  • GetLineFromChar Method
  • Programming Category: Line and Character Operations


TXTextControl.TXTextControl.GetCharRect Method

Returns the rectangular area covered by a certain character. The dimensions are given in twips with an origin at the upper left corner of the Text Control's complete text. The relationship between the upper left corner of the complete text and the upper left corner of the control can be obtained with the ScrollPosX and the ScrollPosY properties.

Introduced: 22.0.

Syntax

TXTextControl.GetCharRect Char
Parameter | Description
Char | Specifies the index of the character which rectangle is returned. The index of the first character is zero.

Return Value

The method returns an array of 4 long values specifying the left, top, right and bottom border of the requested rectangle in twips.

Data Types

Char: | Long
Return value: | Array of 4 Long

See Also

  • ScrollPosX Property
  • ScrollPosY Property
  • GetLineRect Method
  • Programming Category: Line and Character Operations


TXTextControl.TXTextControl.GetLineCount Method

Returns the number of text lines in a Text Control.

Syntax

TXTextControl.GetLineCount

Return Value

The method returns the number of text lines.

Data Types

Return value: Long

See Also

  • GetLineFromChar Method
  • GetLineFromPoint Method
  • Programming Category: Line and Character Operations


TXTextControl.TXTextControl.GetLineFromChar Method

Returns the index of the line which contains the character with the specified character position.

Syntax

TXTextControl.GetLineFromChar Char
Parameter | Description
Char | Specifies the position of the character whose line index is returned. The position of the first character is zero.

Return Value

The method returns a line index, starting with 0 for the first line. The return value is -1 if an error has occurred or if the specified character position does not exist.

Data Types

Char: | Long
Return value: | Long

See Also

  • GetLineCount Method
  • GetCharFromLine Method
  • GetLineFromPoint Method
  • Programming Category: Line and Character Operations


TXTextControl.TXTextControl.GetLineFromPoint Method

Returns the index of the line which contains a given point. The point must be specified in pixels from the top left corner of the control.

Syntax

TXTextControl.GetLineFromPoint X, Y
Parameter | Description
X, Y | Specifies a geometric position in pixels.

Return Value

The method returns a line index, starting with 0 for the first line. The return value is -1 if an error has occurred.

Data Types

X, Y: | Long
Return value: | Long

See Also

  • GetLineCount Method
  • GetLineFromChar Method
  • Programming Category: Line and Character Operations


TXTextControl.TXTextControl.GetLineRect Method

Returns the rectangular area covered by a line of text. The rectangle does not include the external leading area, additional linespacing or paragraph indents. The dimensions are given in twips with an origin at the upper left corner of the Text Control's complete text. The relationship between the upper left corner of the complete text and the upper left corner of the control can be obtained with the ScrollPosY property.

Syntax

TXTextControl.GetLineRect Line
Parameter | Description
Line | Specifies the index of the line which rectangle is returned. The index of the first line is zero.

Return Value

The method returns an array of 4 long values specifying the left, top, right and bottom border of the requested rectangle in twips.

Data Types

Line: | Long
Return value: | Array of 4 Long

See Also

  • ScrollPosY Property
  • GetBaseLinePos Method
  • Programming Category: Line and Character Operations


TXTextControl.TXTextControl.GetTextExtent Method

Returns the extension of the complete text in twips. The text width is the largest line width of the currently contained text. Both values are in 100 percent independent of the zoom factor currently set. The text height is at least the height of the first line even if there is no text.

Syntax

TXTextControl.GetTextExtent

Return Value

The method returns an array of 2 long values specifying the width and the height of the text.

Data Types

Return value: Array of 2 Long

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.GrowFont Method

Increases the font size of each font contained in the current text selection. If no text is selected, this method increases the font size at the text input position. The font sizes used with this method are the same as shown through the Button Bar or the built-in font dialog.

Introduced: 16.0.

Syntax

TXTextControl.GrowFont

Return Value

The return value is True, if at least one font size could be changed. It is False, if the maximum value has been reached.

Data Types

Return value: Boolean

See Also

  • Programming Category: Character Formatting


TXTextControl.TXTextControl.HeaderFooter Property

This property determines which kind of headers and/or footers the document or a section contains. Headers and footers are only displayed, if the ViewMode property has been set to Page View. The SectionCurrent property determines the part of the document. Using this property, a header or footer is not automatically activated. The HeaderFooterActivate method or the built-in mouse interface can be used to activate a header or footer.

Syntax

TXTextControl.HeaderFooter [= HeadersFooters]
Setting | Description
txHeader (1) | Inserts a header.
txFirstHeader (2) | Inserts a special header for the first page.
txFooter (4) | Inserts a footer.
txFirstFooter (8) | Inserts a special footer for the first page.
txEvenHeader (128) | Inserts an even header.
txEvenFooter (256) | Inserts an even footer.

Remarks

The property value can be the sum of one or more of the specified settings.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Headers and Footers
  • HeaderFooterActivate Method
  • HeaderFooterStyle Property
  • Programming Category: Headers and Footers


TXTextControl.TXTextControl.HeaderFooterActivate Method

Activates or deactivates a header or footer. The SectionCurrent property determines the section, the header or footer of which is activated. During activation the current input focus is set to the header or footer area, so that the user can alter the text and/or the format. During deactivation the input focus is set back to the main text.

Syntax

TXTextControl.HeaderFooterActivate HeaderFooter
Parameter | Description
HeaderFooter | Specifies the header or footer to activate. Valid values are described in Constants.

Return Value

The method returns True, if a header or footer could be activated, otherwise it returns False.

Constants

Valid values for the HeaderFooter parameter are:

Constant | Description
0 | A currently activated header or footer is deactivated.
txHeader (1) | Activates the header.
txFirstHeader (2) | Activates the special header of the first page.
txFooter (4) | Activates the footer.
txFirstFooter (8) | Activates the special footer of the first page.
txEvenHeader (128) | Activates the even header.
txEvenFooter (256) | Activates the even footer.

Data Types

HeaderFooter: | Integer
Return value: | Boolean

See Also

  • Headers and Footers
  • Programming Category: Headers and Footers


TXTextControl.TXTextControl.HeaderFooterActivated Event

Occurs when a header or footer has been activated. The SectionCurrent property receives the number of the section to which the header or footer belongs.

Syntax

HeaderFooterActivated(HeaderFooter)
Parameter | Description
HeaderFooter | Specifies the header or footer that has been activated. Valid values are listed in Constants.

Constants

Valid values for the HeaderFooter parameter are:

Constant | Description
txHeader (1) | A header has been activated. It is the odd header, when an even header exists.
txFirstHeader (2) | The special header for the first page has been activated.
txFooter (4) | A footer has been activated. It is the odd footer, when an even footer exists.
txFirstFooter (8) | The special footer for the first page has been activated.
txEvenHeader (128) | An even header has been activated.
txEvenFooter (256) | An even footer has been activated.

Data Types

HeaderFooter: Integer

See Also

  • Headers and Footers
  • HeaderFooterDeactivated Event
  • Programming Category: Headers and Footers


TXTextControl.TXTextControl.HeaderFooterAtInputPos Property

Returns which header or footer owns the current text input position. To own the current text input position a header or footer must be activated. Even if a header or footer looses the current input focus to another program, it remains activated and owns the current text input positon furthermore. The SectionCurrent property receives the section number. It is either the number of the section (one-based), the activated header or footer belongs to, or the number of the section in the main text that contains the current text input position.

Introduced: 12.0.

Syntax

TXTextControl.HeaderFooterAtInputPos
Setting | Description
txHeader (1) | The header owns the text input position.
txFirstHeader (2) | The special header for the first page owns the text input position.
txFooter (4) | The footer owns the text input position.
txFirstFooter (8) | The special footer for the first page owns the text input position.
txMainText (16) | The main text owns the text input position.
txEvenHeader (128) | The even header owns the text input position.
txEvenFooter (256) | The even footer owns the text input position.

Data Types

Integer.

Limitations

Read only, run time only.

See Also

  • Headers and Footers
  • TableAtInputPos Property
  • FieldAtInputPos Property
  • Programming Category: Headers and Footers


TXTextControl.TXTextControl.HeaderFooterConnectedToPrevious Property

This property returns or sets a value specifying whether a header or footer is connected with the header or footer of the previous section. If headers or footers are connected, they have always the same contents. The SectionCurrent property determines the section, the header or footer belongs to.

Introduced: 14.0.

Syntax

TXTextControl.HeaderFooterConnectedToPrevious(HeaderFooter) [= value]
Parameter | Description
HeaderFooter | Specifies the kind of the header or footer. Valid values are listed in Constants.

Constants

Valid values for the HeaderFooter parameter are:

Constant | Description
txHeader (1) | Specifies the header.
txFirstHeader (2) | Specifies the special header for the first page.
txFooter (4) | Specifies the footer.
txFirstFooter (8) | Specifies the special footer for the first page.
txEvenHeader (128) | Specifies the even header.
txEvenFooter (256) | Specifies the even footer.

Data Types

HeaderFooter: | Integer
Property value: | Boolean

Limitations

Run time only.

See Also

  • Headers and Footers
  • Programming Category: Headers and Footers


TXTextControl.TXTextControl.HeaderFooterDeactivated Event

Occurs when a header or footer has been deactivated. The SectionCurrent property receives the number of the section to which the header or footer belongs.

Syntax

HeaderFooterDeactivated(HeaderFooter)
Parameter | Description
HeaderFooter | Specifies the header or footer that has been deactivated. Valid values are listed in Constants.

Constants

Valid values for the HeaderFooter parameter are:

Constant | Description
txHeader (1) | A header has been deactivated.
txFirstHeader (2) | The special header for the first page has been deactivated.
txFooter (4) | A footer has been deactivated.
txFirstFooter (8) | The special footer for the first page has been deactivated.
txEvenHeader (128) | An even header has been deactivated.
txEvenFooter (256) | An even footer has been deactivated.

Data Types

HeaderFooter: Integer

See Also

  • Headers and Footers
  • HeaderFooterActivated Event
  • Programming Category: Headers and Footers


TXTextControl.TXTextControl.HeaderFooterPosition Property

This property specifies the position of a header or footer. For headers, the position value is the distance between the top of the header and the top of the page. For footers, the position value is the distance between the bottom of the footer and the bottom of the page. All values are in twips. The default value is 567 twips = 1 cm. The SectionCurrent property determines the section, the header or footer belongs to. The property returns -1, if more than one section is specified through the SectionCurrent property and these sections' header or footer position are different.

Syntax

TXTextControl.HeaderFooterPosition(HeaderFooter) [= position]
Parameter | Description
HeaderFooter | Specifies the header or footer the position of which is to be set. Valid values are listed in Constants.

Constants

Valid values for the HeaderFooter parameter are:

Constant | Description
txHeader (1) | Specifies the header.
txFirstHeader (2) | Specifies the special header for the first page.
txFooter (4) | Specifies the footer.
txFirstFooter (8) | Specifies the special footer for the first page.
txEvenHeader (128) | Specifies the even header.
txEvenFooter (256) | Specifies the even footer.

Data Types

HeaderFooter: | Integer
Property value: | Long

Limitations

Run time only.

See Also

  • Headers and Footers
  • Programming Category: Headers and Footers


TXTextControl.TXTextControl.HeaderFooterSelect Method

This method determines whether a certain Text Control property or method manipulates a header or a footer or the main text. The SectionCurrent property determines the section, the header or footer of which is selected. This method does not activate a header or footer.

Syntax

TXTextControl.HeaderFooterSelect HeaderFooter
Parameter | Description
HeaderFooter | Specifies the part of the text that is to be selected. See the Constants section for valid values.

Return Value

The method returns True, if a header or footer could be selected, otherwise it returns False.

Constants

Valid values for the HeaderFooter parameter are:

Constant | Description
0 | Text Control performs automatic selection, which means that a certain property or method manipulates the text part with the current input position.
txHeader (1) | Selects the header.
txFirstHeader (2) | Selects the special header for the first page.
txFooter (4) | Selects the footer.
txFirstFooter (8) | Selects the special footer for the first page.
txMainText (16) | Selects the main text.
txEvenHeader (128) | Selects the even header.
txEvenFooter (256) | Selects the even footer.

Data Types

HeaderFooter: | Integer
Return value: | Boolean

Example

This Basic example selects the header, alters the text of the header and returns to the automatic mode:

TXTextControl1.HeaderFooterSelect txHeader
TXTextControl1.Text = "This is the header's text"
TXTextControl1.HeaderFooterSelect 0

See Also

  • Headers and Footers
  • Programming Category: Headers and Footers


TXTextControl.TXTextControl.HeaderFooterStyle Property

This property determines how headers and footers can be activated and how activated headers and footers appear on the screen.

Syntax

TXTextControl.HeaderFooterStyle [= style]
Setting | Description
txMouseClick (1) | Headers and footers can be activated through single mouse clicks.
txNoDblClk (2) | Headers and footers cannot be activated through mouse double-clicks.
txSolidFrame (4) | An activated header or footer has a solid border to indicate its size.
txUnframed (8) | An activated header or footer has no border.
txDividingLine (16) | An activated header or footer is divided from the main text with a dashed line.

Remarks

The property value can be the sum of one or more of the specified settings. By default a header or footer is activated with a mouse double-click and is divided from the main text with a dashed line.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Headers and Footers
  • Programming Category: Headers and Footers


TXTextControl.TXTextControl.HExpand Event

Occurs when the Text Control has changed its window size horizontally. This event can only occur when the AutoExpand property is set to True.

Syntax

HExpand( )

See Also

  • AutoExpand Property
  • VExpand Event
  • Programming Category: Control Settings


TXTextControl.TXTextControl.HideSelection Property

Specifies whether a text selection is hidden when the Text Control looses the input focus.

Syntax

TXTextControl.HideSelection [= boolean]
Setting | Description
True | (Default) The selection is hidden when the Text Control looses the input focus and shown when the Text Control gets the input focus.
False | The selection stays visible, independent of the current input focus.

Data Types

Boolean.

See Also

  • Programming Category: Text Selections and Character Input


TXTextControl.TXTextControl.HScroll Event

Occurs when the horizontal scroll position has been changed. This event cannot occur, if the ViewMode property has been set to Simple Control.

Syntax

HScroll( )

See Also

  • VScroll Event
  • Programming Category: Scrolling


TXTextControl.TXTextControl.hWnd Property

Returns a handle to a Text Control.

Syntax

TXTextControl.hWnd

Remarks

The hWnd property is used with Windows API calls. Many Windows operating enviroment functions require the hWnd of the active window as an argument.

Data Types

Handle.

Limitations

Read only, run time only.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.ImageDisplayMode Property

Provides several modes to set the way in which images are displayed or refreshed. The ObjectCurrent property determines the image.

Syntax

TXTextControl.ImageDisplayMode [= value]
Setting | Description
0 | (Default) Standard mode.
&H1 | Displays an image as a gray rectangle.
&H2 | Container mode. This mode ensures proper refreshing when the image is used as a background image for transparent controls.

Remarks

The property settings can be combined by adding the desired constant values.

Data Types

Integer.

Limitations

Run time only.

See Also

  • ImageInsert Method
  • ImageInsertAsChar Method
  • ImageInsertFixed Method
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ImageExportCompressionQuality Property

Determines a value between 1 and 100, which is the quality of a lossy data compression used, if the image is saved. It is only used, if the image data is compressed with a lossy compression algorithm. A value of 100 indicates the maximum quality, a value of 1 indicates the minimum quality. If this property is set to zero, which is the default value, TX Text Control uses the quality value set with the LoadSaveAttribute property (txImageCompressionQuality value) or a compression specific default value. The ObjectCurrent property determines the image.

Introduced: 11.0.

Syntax

TXTextControl.ImageExportCompressionQuality [= value]

Data Types

Integer.

Limitations

Run time only.

See Also

  • ObjectCurrent Property
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ImageExportFilename Property

Determines the file name of an image used if a document is saved. The ObjectCurrent property determines the image.

Syntax

TXTextControl.ImageExportFilename [= string]

Data Types

String.

Limitations

Run time only.

See Also

  • ObjectCurrent Property
  • ImageExportFormat Property
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ImageExportFilters Property

This property returns a string which specifies the available filters for exporting images. The filter names are separated through a '|' sign. It can be used to initialize the Filter property of a Common Dialog Control.

Syntax

TXTextControl.ImageExportFilters

Data Types

String.

Limitations

Read only, run time only.

See Also

  • ImageFilters Property
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ImageExportFormat Property

Determines the format used if an image is saved. This is the number of the filter in the string returned through the ImageExportFilters property, beginning with number one. If the ImageExportFilters property is used to initialize the Filter property of a Common Dialog Control, the FilterIndex property of the Common Dialog Control can be used to set this property. The ObjectCurrent property determines the image.

Syntax

TXTextControl.ImageExportFormat [= index]

Data Types

Integer.

Limitations

Run time only.

See Also

  • ObjectCurrent Property
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ImageExportMaxResolution Property

Determines the maximum resolution in dots per inch used, if the image is saved. If the image's resolution is larger than this property's value, it is reduced, otherwise it is not changed. If this property's value is zero, which is the default value, TX Text Control uses the maximum resolution set with the LoadSaveAttribute property (txImageMaxResolution value) or the image's default resolution. The ObjectCurrent property determines the image.

Introduced: 11.0.

Syntax

TXTextControl.ImageExportMaxResolution [= value]

Data Types

Integer.

Limitations

Run time only.

See Also

  • ObjectCurrent Property
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ImageFilename Property

Determines the image file name of an inserted image. The ObjectCurrent property determines the image.

Syntax

TXTextControl.ImageFilename [= string]

Data Types

String.

Limitations

Run time only.

See Also

  • ObjectCurrent Property
  • ImageInsert Method
  • ImageInsertAsChar Method
  • ImageInsertFixed Method
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ImageFilters Property

This property returns a string which specifies the available image filters. The filter names are separated through a '|' sign. This string can be used to initialize the Filter property of a Common Dialog control.

Syntax

TXTextControl.ImageFilters

Data Types

String.

Limitations

Read only, run time only.

Example

This Basic example initializes an OpenFile dialog box with the names of the available image filters and then loads a selected image:

dlgFile.DialogTitle = "Insert Image"
dlgFile.Filename = ""
dlgFile.Filter = TXTextControl1.ImageFilters
dlgFile.FilterIndex = 1
dlgFile.Flags = cdlOFNPathMustExist Or cdlOFNFileMustExist _
   Or cdlOFNHideReadOnly
dlgFile.CancelError = True
dlgFile.ShowOpen
TXTextControl1.ImageInsertAsChar dlgFile.Filename, -1, 100, 100

See Also

  • ImageExportFilters Property
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ImageInsert Method

This method inserts a new image anchored to a paragraph. The text flows around the image.

Introduced: 12.0.

Syntax

TXTextControl.ImageInsert FileName, TextPos, Alignment, PosX, PosY, ScaleX, ScaleY, TextFlow, DistanceL, DistanceT, DistanceR, DistanceB
Parameter Description
FileName

Specifies the image file with a full path name.
TextPos

Specifies a text position in the paragraph where the image should be inserted. If TextPos is -1, the image is anchored to the paragraph at the current input position.
Alignment

Specifies the image's horizontal alignment. It can be one of the following values:

Value | Description
0 | The horizontal position is given through the PosX parameter.
1 | The image is left aligned relative to the paragraph to which it is anchored.
2 | The image is right aligned relative to the paragraph to which it is anchored.
3 | The image is centered relative to the paragraph to which it is anchored.
PosX

Specifies the image's horizontal position in twips, relative to the left border of the paragraph. This value is used if the Alignment parameter has been set to 0.
PosY

Specifies the image's vertical position in twips relative to the top border of the paragraph.
ScaleX

Specifies a horizontal scaling factor as a percentage.
ScaleY

Specifies a vertical scaling factor as a percentage.
TextFlow

Specifies how text flows around the image. It can be one of the following values:

Value | Description
2 | The text stops at the top and continues at the bottom of the image.
3 | The text flows around the image. Empty areas at the left and right side are filled.
DistanceL, DistanceT, DistanceR, DistanceB

Specifies distances, in twips, between the image and the document's text.

Return Value

The method returns the image's identifier, if a new image could be inserted. Otherwise, it returns zero. The image's identifier can also be obtained with the ObjectCurrent property.

Data Types

FileName: | String
TextPos: | Long
Alignment: | Integer
PosX: | Long
PosY: | Long
ScaleX: | Integer
ScaleY: | Integer
TextFlow: | Integer
DistanceL: | Integer
DistanceT: | Integer
DistanceR: | Integer
DistanceB: | Integer
Return value: | Integer

See Also

  • ImageInsertAsChar Method
  • ImageInsertFixed Method
  • Object and image attribute properties
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ImageInsertAsChar Method

This method inserts a new image which is then handled like a single character in the text.

Introduced: 12.0.

Syntax

TXTextControl.ImageInsertAsChar FileName, TextPos, ScaleX, ScaleY
Parameter | Description
FileName | Specifies the image file with a full path name.
TextPos | Specifies a text position where the image should be inserted. If TextPos is -1, the image is inserted at the current input position.
ScaleX | Specifies a horizontal scaling factor as a percentage.
ScaleY | Specifies a vertical scaling factor as a percentage.

Return Value

The method returns the image's identifier, if a new image could be inserted. Otherwise, it returns zero. The image's identifier can also be obtained with the ObjectCurrent property.

Data Types

FileName: | String
TextPos: | Long
ScaleX: | Integer
ScaleY: | Integer
Return value: | Integer

See Also

  • ImageInsert Method
  • ImageInsertFixed Method
  • Object and image attribute properties
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ImageInsertFixed Method

This method inserts a new image at a fixed geometrical position. The text flows around the image.

Introduced: 12.0.

Syntax

TXTextControl.ImageInsertFixed FileName, PageNo, PosX, PosY, ScaleX, ScaleY, TextFlow, DistanceL, DistanceT, DistanceR, DistanceB
Parameter Description
FileName

Specifies the image file with a full path name.
PageNo

Specifies the number of the page where the image is inserted, beginning with number 1. If the ViewMode property has not been set to Page View, this parameter must be set to zero. In this case the PosY parameter specifies the position relative to the top of the control.
PosX

Specifies the image's horizontal position in twips relative to the left border of the page.
PosY

Specifies the image's vertical position in twips relative to the top border of the page or control.
ScaleX

Specifies a horizontal scaling factor as a percentage.
ScaleY

Specifies a vertical scaling factor as a percentage.
TextFlow

Specifies how text flows around the image. It can be one of the following values:

Value | Description
2 | The text stops at the top and continues at the bottom of the image.
3 | The text flows around the image. Empty areas at the left and right side are filled.
DistanceL, DistanceT, DistanceR, DistanceB

Specifies distances, in twips, between the image and the document's text.

Return Value

The method returns the image's identifier, if a new image could be inserted. Otherwise, it returns zero. The image's identifier can also be obtained with the ObjectCurrent property.

Data Types

FileName: | String
PageNo: | Long
PosX: | Long
PosY: | Long
ScaleX: | Integer
ScaleY: | Integer
TextFlow: | Integer
DistanceL: | Integer
DistanceT: | Integer
DistanceR: | Integer
DistanceB: | Integer
Return value: | Integer

See Also

  • ImageInsertAsChar Method
  • ImageInsert Method
  • Object and image attribute properties
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ImageSaveMode Property

Determines whether the image is stored through its data or through its file reference. By default an image is stored through a file reference if a file reference exist. Otherwise, if the image has been pasted from the clipboard, it is stored with its complete binary data. The ObjectCurrent property determines the image.

Syntax

TXTextControl.ImageSaveMode [= value]
Setting | Description
0 | Automatic mode. The image is saved as specified with txImageSaveMode attribute of the LoadSaveAttribute property. When this property is not set, the image is saved with a file reference or when no file reference exists with its binary data.
1 | The image is saved with its complete binary data.
2 | The image is saved through a file reference. If a file does not exist, a new one is created.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Save Method
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.IncreaseIndent Method

Increases the left indent of all paragraphs contained in the current text selection. If no text is selected, this method increases the left indent at the text input position. Left indent positions are defined through the paragraphs' tab positions and the indents of the paragraphs in front and behind the paragraph with the text input position.

Introduced: 16.0.

Syntax

TXTextControl.IncreaseIndent

Return Value

The return value is True, if at least one indent could be changed. It is False, if the maximum value has been reached.

Data Types

Return value: Boolean

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.IndentB Property

Returns or sets an additional bottom distance (in twips) for a paragraph or a selected range of paragraphs.

Syntax

TXTextControl.IndentB [= value]

Remarks

If a number of paragraphs have been selected which have different settings for the bottom distance, the property returns &H8000.

Data Types

Integer.

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.IndentFL Property

Returns or sets an additional left indent (in twips) for the first line of a paragraph or a selected range of paragraphs. This value can be negative.

Syntax

TXTextControl.IndentFL [= value]

Remarks

If a number of paragraphs have been selected which have different settings for the first line indent, the property returns &H8000.

Data Types

Integer.

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.IndentL Property

Returns or sets the left indent (in twips) for a paragraph or a selected range of paragraphs.

Syntax

TXTextControl.IndentL [= value]

Remarks

If a number of paragraphs have been selected which have different settings for the left indent, the property returns &H8000.

Data Types

Integer.

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.IndentR Property

Returns or sets the right indent (in twips) for a paragraph or a selected range of paragraphs.

Syntax

TXTextControl.IndentR [= value]

Remarks

If a number of paragraphs have been selected which have different settings for the right indent, the property returns &H8000.

Data Types

Integer.

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.IndentT Property

Returns or sets an additional top distance (in twips) for a paragraph or a selected range of paragraphs.

Syntax

TXTextControl.IndentT [= value]

Remarks

If a number of paragraphs have been selected which have different settings for the top distance, the property returns &H8000.

Data Types

Integer.

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.InputPosFromPoint Method

Returns the text input position belonging to a certain geometric position. The text input position is relative to the beginning of the text and the geometric position is a position in the visible part of the text.

Syntax

TXTextControl.InputPosFromPoint X, Y
Parameter | Description
X, Y | Specify the coordinates of the point. These values must be in twips.

Return Value

The method returns the text input position beginning with zero for the position in front of the first character. The method returns -1, if a text position could not be found.

Data Types

X, Y: | Long
Return value: | Long

See Also

  • Programming Category: Text Selections and Character Input


TXTextControl.TXTextControl.InsertionMode Property

Specifies whether text is inserted or overwrites existing text.

Syntax

TXTextControl.InsertionMode [= boolean]
Setting | Description
True | (Default) New text is inserted.
False | New text overwrites existing text.

Data Types

Boolean.

See Also

  • Programming Category: Text Selections and Character Input


TXTextControl.TXTextControl.InsertSymbolDialog Method

Opens a modeless dialog box which can be used to insert symbol characters.

Introduced: 23.0.

Syntax

TXTextControl.InsertSymbolDialog

Return Value

This method has no return value.

See Also

  • Programming Category: Character Formatting
  • Programming Category: Built-in Dialog Boxes


TXTextControl.TXTextControl.Justification Property

Gets or sets the kind of justification in documents containing Arabic or Hebrew characters. If a paragraph is justified, the additional space to justify the line is added to the spaces between the words. When the line contains Arabic or Hebrew characters the line can also be justified through the insertion of Kashida lines.

Introduced: 20.0.

Syntax

TXTextControl.Justification [= value]
Setting | Description
(Default) txSpaces | To justify a line additional space is added to the spaces between the words.
txKashida | To justify a line Kashida lines are inserted.
txSpacesAndKashida | To justify a line both kinds of justification are used.
0 | Get only. The property returns 0, if more than one paragraph is selected and these paragraphs have different justification settings.

Remarks

If the FormatSelection property has previously been set to True, changing this property affects only the currently selected paragaphs. If FormatSelection has been set to False, the setting applies to the entire control.

Data Types

Integer.

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.KeepLinesTogether Property

Gets or sets a value indicating whether a page break is allowed within a paragraph. If the property's value is true, a page break is not allowed. Otherwise, it is allowed. The property sets the value for all paragraphs currently selected.

Introduced: 13.0.

Syntax

TXTextControl.KeepLinesTogether [= boolean]

Remarks

The property returns false when the text selection contains multiple paragraphs with mixed setting.

Data Types

Boolean.

Limitations

Run time only.

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.KeepWithNext Property

If this property is set to true for a paragraph, it is displayed on the same page as its following paragraph. The property sets the value for all paragraphs currently selected.

Introduced: 13.0.

Syntax

TXTextControl.KeepWithNext [= boolean]

Remarks

The property returns false when the text selection contains multiple paragraphs with mixed setting.

Data Types

Boolean.

Limitations

Run time only.

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.KeyDown Event

Occurs when the user presses a key while the Text Control has the input focus. To interpret ANSI characters, use the KeyPress event.

Syntax

KeyDown(KeyCode, Shift)
Parameter Description
KeyCode

Is the virtual-key code of the pressed key. When this value is changed, Text Control handles the changed key.
Shift

Informs about the state of the SHIFT, CTRL and ALT keys at the time of the event. It is the sum of one or more of the following values:

Value | Description
1 | The SHIFT key was pressed at the time of the event.
2 | The CTRL key was pressed at the time of the event.
4 | The ALT key was pressed at the time of the event.

Data Types

KeyCode: | Integer
Shift: | Integer

See Also

  • KeyPress Event
  • KeyUp Event
  • Programming Category: Text Selections and Character Input


TXTextControl.TXTextControl.KeyPress Event

Occurs when the user presses and releases an ANSI key while the Text Control has the input focus.

Syntax

KeyPress(KeyAscii)
Parameter | Description
KeyAscii | Is a standard numeric ANSI keycode. Changing it sends a different character to the Text Control.

Data Types

KeyAscii: Integer

See Also

  • KeyDown Event
  • KeyUp Event
  • Programming Category: Text Selections and Character Input


TXTextControl.TXTextControl.KeyStateChange Event

Occurs when the character insertion mode or when the state of the NUMLOCK or CAPSLOCK key has been changed.

Syntax

KeyStateChange( )

See Also

  • Programming Category: Text Selections and Character Input


TXTextControl.TXTextControl.KeyUp Event

Occurs when the user releases a key while the Text Control has the input focus. To interpret ANSI characters, use the KeyPress event.

Syntax

KeyUp(KeyCode, Shift)
Parameter Description
KeyCode

Is the virtual-key code of the released key. When this value is changed, Text Control handles the changed key.
Shift

Informs about the state of the SHIFT, CTRL and ALT keys at the time of the event. It is the sum of one or more of the following values:

Value | Description
1 | The SHIFT key was pressed at the time of the event.
2 | The CTRL key was pressed at the time of the event.
4 | The ALT key was pressed at the time of the event.

Data Types

KeyCode: | Integer
Shift: | Integer

See Also

  • KeyDown Event
  • KeyPress Event
  • Programming Category: Text Selections and Character Input


TXTextControl.TXTextControl.Language Property

Determines the language in which Text Control displays dialog boxes and error messages. Text Control has several built-in languages, additional languages can be added with the ResourceFile property. The default language is the Windows system language. See Technical Articles - Resources for more information.

Syntax

TXTextControl.Language [= value]
Setting | Description
33 | French
34 | Spanish
39 | Italian
41 | German (Switzerland)
43 | German (Austria)
49 | German
else | English

Data Types

Integer.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.LineSpacing Property

Specifies the line spacing for the currently selected paragraphs as a percentage of the font size.

Syntax

TXTextControl.LineSpacing [= value]

Data Types

Integer.

See Also

  • FormatSelection Property
  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.LineSpacingT Property

Specifies the line spacing for the currently selected paragraphs in twips.

Syntax

TXTextControl.LineSpacingT [= value]

Data Types

Integer.

See Also

  • FormatSelection Property
  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.ListAttrDialog Method

Invokes the Text Control's built-in dialog box for setting attributes of bulleted and numbered lists.

Syntax

TXTextControl.ListAttrDialog

Return Value

The method returns True when the user has changed one or more attributes. The method returns False when nothing has been changed.

Remarks

The changes, made in the dialog box, apply to the currently selected text.

Data Types

Return value: Boolean

See Also

  • Programming Category: Bullets and Numbered Lists
  • Programming Category: Built-in Dialog Boxes


TXTextControl.TXTextControl.ListType Property

Returns or sets a list type for a paragraph or a selected range of paragraphs. Possible lists are bulleted and numbered lists. Attributes for bulleted lists can be set with the BulletAttribute property and attributes for numbered lists can be set with the NumberingAttribute property.

Syntax

TXTextControl.ListType [=  Type]
Setting | Description
txListNone (1) | Resets paragraphs with bulleted or numbered list attributes to paragraphs without such features.
txListBulleted (2) | Defines a list with bullets.
txListNumbered (4) | Defines a numbered list.
txListStructured (8) | Defines a structured numbered list.

Remarks

If several paragraphs belonging to different lists are selected the property returns a combination of the constants listed above.

Data Types

Integer.

Limitations

Run time only.

See Also

  • BulletAttribute Property
  • ListAttrDialog Method
  • NumberingAttribute Property
  • Programming Category: Bullets and Numbered Lists


TXTextControl.TXTextControl.Load Method

Loads text in a certain format from a file and inserts it into the Text Control.

Syntax

TXTextControl.Load FileName[, Offset[, Format[, CurSelection]]]
Parameter Description
FileName

Specifies the file to load from.
Offset

Optional. Specifies the file position from where the data is read. When not specified or set to zero the data is read from the beginning.
Format

Optional. Specifies a format identifier. When not specified Text Control assumes Text Control's internal format (3). Otherwise it can be one of the following values:

Constant | Description
1 - ANSI text | Text in Windows ANSI format (an end of a paragraph is marked with the control characters 13 and 10).
2 - TX text | Text in ANSI format (an end of a paragraph is marked only with the control character 10).
3 - TX | Text including formatting attributes in the internal Text Control format. Text is stored in ANSI.
4 - HTML | HTML format (Hypertext Markup Language).
5 - RTF | RTF format (Rich Text Format).
6 - Unicode text | Text in Windows Unicode format (an end of a paragraph is marked with the control characters 13 and 10).
7 - TX text | Text in Unicode format (an end of a paragraph is marked only with the control character 10).
8 - TX | Text including formatting attributes in the internal Text Control format. Text is stored in Unicode.
9 - Microsoft Word 97-2003 | Microsoft Word 97-2003 format (*.doc).
10 - XML | XML format (Extensible Markup Language).
11 - CSS | CSS format (Cascading Style Sheet).
13 - Microsoft Word | Microsoft Word format (*.docx).
CurSelection

Optional. When set to true the loaded data replaces the current selection or is inserted at the current input position. The new input position is behind the inserted data. When omitted or set to false the loaded data replaces the complete control contents independent of the current selection. The new input position is at the beginning of the data.

Return Value

The method returns the position in the file after the data has been loaded.

Data Types

FileName: | String
Offset: | Long
Format: | Integer
CurSelection: | Boolean
Return value: | Long

Example

This Basic example opens a file and loads its contents into TXTextControl1:

Private Sub mnuFile_Load_Click()
   On Error Resume Next
   ' Create an "Open File" dialog box
   CommonDialog1.Filter = "TX Demo (*.tx)|*.tx"
   CommonDialog1.DialogTitle = "Open"
   CommonDialog1.Flags = cdlOFNFileMustExist Or _
      cdlOFNHideReadOnly
   CommonDialog1.CancelError = True
   CommonDialog1.ShowOpen
   If Err Then Exit Sub
   ' Pass the filename to the text control
   TXTextControl1.Load CommonDialog1.filename
End Sub

See Also

  • PDF Export
  • Save Method
  • Programming Category: Loading, Saving and Database Support


TXTextControl.TXTextControl.LoadFromMemory Method

Loads text in a certain format from a buffer and inserts it into the Text Control.

Syntax

TXTextControl.LoadFromMemory DataArray[, Format[, CurSelection]]
Parameter | Description
DataArray | Specifies the byte array to load from.
Format | Optional. Specifies a format identifier. When not specified Text Control assumes Text Control's internal format (3). See the Format parameter of the Load method for possible format identifiers.
CurSelection | Optional. When set to true the loaded data replaces the current selection or is inserted at the current input position. The new input position is behind the inserted data. When omitted or set to false the loaded data replaces the complete control contents independent of the current selection. The new input position is at the beginning of the data.

Return Value

The method returns True if the data could be loaded, otherwise it returns False.

Data Types

DataArray: | One-dimensional Byte Array
Format: | Integer
CurSelection: | Boolean
Return value: | Boolean

See Also

  • PDF Export
  • Load Method
  • SaveToMemory Method
  • Programming Category: Loading, Saving and Database Support


TXTextControl.TXTextControl.LoadSaveAttribute Property

This property enables an application to specify several attributes that can be used in combination with the Load and Save methods for the following situations: 1. Documents can contain elements, for example a document title, that cannot be converted directly to text properties but may be useful for certain applications. Such an attribute can be set before a document is saved, in order to store it as part of the document, or it can be provided and used after a document has been loaded. 2. In some documents generic information about text properties is left out, for example with HTML documents which define font heights as a percentage of a base height without specifying that base height. Such an attribute can be set before a document is loaded, in order to inform the filter how to calculate such relative values.

Syntax

TXTextControl.LoadSaveAttribute(Attribute) [= value]
Parameter | Description
Attribute | Determines the attribute that is to be changed or returned. Possible values are listed in Constants.

Constants

Valid values for the Attribute parameter are:

Constant Description
txDocWidth (0)

Loads or saves a document width in twips. When this property is set before a document is loaded, it is used to calculate width values contained in the document which are relative to the document's width. After a document has been loaded, this property returns the width, contained in the document, or -1 if the document does not contain a width. When a document is saved and this property has not been set, Text Control saves the value of the PageWidth property instead, except this property has been set to -1 previously.
txDocHeight (1)

Loads or saves a document height in twips. It is used in the same manner as described for the txDocWidth attribute.
txDocLeftMargin (2)

Loads or saves a left document margin in twentieths of a point. After a document has been loaded, this property returns the margin contained in the document, or -1 if the document does not contain the margin. When a document is saved and this property has not been set, Text Control saves the value of the PageMarginL property instead, except this property has been set to -1 previously.
txDocTopMargin (3)

Loads or saves a top document margin in twentieths of a point. It is used in the same manner as described for the txDocLeftMargin attribute.
txDocRightMargin (4)

Loads or saves a right document margin in twentieths of a point. It is used in the same manner as described for the txDocLeftMargin attribute.
txDocBottomMargin (5)

Loads or saves a bottom document margin in twentieths of a point. It is used in the same manner as described for the txDocLeftMargin attribute.
txDocTitle (6)

Loads or saves a document title. After a document has been loaded, this property returns the document title contained in the document, or an empty string if the document does not contain a title.
txDocBkColor (7)

Loads or saves a document background color as a RGB value. After a document has been loaded, this property returns the background color contained in the document, or -1, if the document does not contain a background color.
txCSSFile (8)

HTML only. Specifies a full or relative path and filename for a CSS file. This file is only used if txCSSSaveMode determines that stylesheet data is saved in a file.
txCSSSaveMode (9)

HTML only. Determines how to save stylesheets in HTML format. It can be one of the following values:

Code | Meaning
0 - Without Stylesheets | All format information is saved in the body of the HTML document.
1 - Inline | Stylesheets are saved in the head of the HTML document.
2 - Create File | Stylesheets are saved in a newly created CSS file. This file has the same name and location as the corresponding HTML file or is specified through the txCSSFile attribute. The file is only created if it does not exist. If the HTML document is saved in a memory buffer this setting cannot be used.
3 - Overwrite File | Stylesheets are saved in a newly created CSS file. This file has the same name and location as the corresponding HTML file or is specified through the txCSSFile attribute. If the file already exists, it is overridden. If the HTML document is saved in a memory buffer, this setting cannot be used.
txDocAccessPermissions (10)

PDF only. Specifies how a document can be accessed after it has been opened. This property has only an effect, if also a password has been specified with the txMasterPassword setting. If no password has been specified, the document can be accessed without any restrictions. The settings value can be a bitwise combination of more than one of the following values.

Code | Meaning
&H1 | Allows authoring comments and fill in interactive form fields (including signature fields).
&H2 | Fill-in existing interactive form fields (including signature fields) is allowed.
&H4 | Allows content access for the visually impaired only.
&H8 | Allows assembly of the the document (insert, rotate or delete pages and create bookmarks or thumbnails).
&H10 | Copying or otherwise extracting text and/or graphics is allowed.
&H20 | Allows modifying the document's contents.
&H40 | Printing the document is fully allowed.
&H80 | Printing the document is allowed (low-level).
txMasterPassword (11)

PDF only. Specifies the password for the document's access permissions. If the password is an empty string, accessing the document is not restricted. If a password is specified, the access permissions are given through the txDocAccessPermissions setting.
txUserPassword (12)

PDF only. Specifies the password for the user to open the document. If the password is an empty string, the document can be opened by every user.
txImageCompressionQuality (13)

Sets a value between 1 and 100, which is the quality of a lossy image compression used when a document is saved. It is used for all images in the document the data of which is compressed with a lossy compression algorithm. A value of 100 indicates the maximum quality, a value of 1 indicates the minimum quality. A value of zero selects a compression specific default value. For a single image the value of this property can be overwritten using the ImageExportCompressionQuality property.
txImageMaxResolution (14)

Sets the maximum resolution for all images in the document in dots per inch when the document is saved. If an image's resolution is larger than this property's value, it is reduced, otherwise it is not changed. If this property's value is zero, which is the default value, the default resolution of each image is used. For a single image the value of this property can be overwritten using the ImageExportMaxResolution property.
txLoadMSWordFields (15)

MS Word and RTF only. Converts MS Word fields into marked text fields of the type txFieldMSWord. The FieldTypeData property can be used to get the field's data.
txLoadHighEditFields (16)

MS Word and RTF only. Converts Heiler HighEdit fields into marked text fields of the type txFieldHighEdit. The FieldTypeData property can be used to get the field's data.
txMSWordFieldTypeNames (17)

Specifies a character string specifying the types of MS Word fields to be loaded. This attribute is only used when the txLoadMSWordFields attribute is set to true. The string can contain several type names that must be separated with tab (09) characters. When a document is saved, this attribute is not used.
txImageSaveMode (18)

Determines whether the document's images are stored through its data or through its file reference. By default images are stored through a file reference, when a file reference exists. Otherwise, if an image has been pasted from the clipboard, it is stored with its binary data. For a single image the value of this attribute can be overwritten with the ImageSaveMode property. It can be one of the following values:

Code | Meaning
0 - Auto | An image is saved with a file reference, when a file reference exists. Otherwise it is saved with its binary data.
1 - SaveAsData | The document's images are saved with their binary data.
2 - SaveAsFileReference | The document's images are saved through file references. For images without a corresponding file a new file is created.
txImageExportFormat (19)

Sets the format used for saving all images contained in the document. The attribute's value is is the number of the filter in the string returned through the ImageExportFilters property, beginning with number one. For a single image the value of this attribute can be overwritten with the ImageExportFormat property.
txCertificateFileName (20)

Specifies the name of a certificate file containing a X.509 certificate. This certificate can be used to digitally sign a PDF or a PDF/A file. For other formats this property has no meaning. When the certificate file contains a private key, a password must be specified with the txCertificatePassword attribute to decrypt the private key.

txCertificatePassword (21)

Specifies the password to decrypt the private key of a certificate file. A certificate file can be specified with the txCertificateFileName attribute. When a file name is not specified, this attribute has no meaning.
txTimeServerURL (22)

Specifies the URL of a time server which is used to get a time stamp for a certification. If this attribute is not specified, the current date and time on the computer is used. When a certificate file is not specified with the txCertificateFileName attribute, this attribute has no meaning.
txDocumentLevelJavaScriptActions (23)

Specifies a character string containing Javascript. The string can contain several scripts which must be separated with 01 control characters. The scripts are embedded in a PDF document at document level and they are executed, when the PDF document is opened. When the document is saved as PDF/A the scripts are not embedded.
txAbsPath (28)

Specifies a character string that is used to search for resources like images or destinations of hypertext links. When a document is loaded, this path is used to locate a resource. It is only used for resources which are specified through an absolute location. In this case the absolute resource location is completely replaced through the path specified through this property. When a document is saved, this attribute is not used.
txBasePath (29)

Specifies a character string that is used to search for resources given through a relative location. When a document is loaded, this path is added to the relative location of a resource. When a document is saved the string can only be a file path. All files in the document are saved relative to this path.
txBaseFontSize (30)

HTML only. Specifies a base font size in points and is used to convert percentage font sizes to absolute font sizes. When not set, a value of 10 points is used. This attribute is only used when a document is loaded.
txPropFontName (31)

HTML only. Defines a proportional font name when not specified in the document. When not set, Text Control uses a default font. This attribute is only used when a document is loaded.
txMonoFontName (32)

HTML only. Defines a mono-spaced font name when not specified in the document. When not set, Text Control uses a default mono-spaced font. This attribute is only used when a document is loaded.
txTextColor (33)

HTML only. Defines a text color. This attribute is only used when a document is loaded. When the txOverwriteTextColor attribute is set to True, this color is used for text coloring. Otherwise when not set to overwrite, this color is only used when no text color is specified in the document.
txOverwriteTextColor (34)

HTML only. Sets the txTextColor attribute to overwrite or not to overwrite.
txTextBkColor (35)

HTML only. Defines a text background color. This attribute is only used when a document is loaded. When the txOverwriteTextBkColor attribute is set to True, this color is used for text background coloring. Otherwise, when not set to overwrite, this color is only used when no text background color is specified in the document.
txOverwriteTextBkColor (36)

HTML only. Sets the txTextBkColor attribute to overwrite or not to overwrite.
txLoadImages (37)

HTML only. Specifies whether or not images are loaded. When not set, images are replaced by its alternate text or a special link text. For all other formats images are always loaded.
txEnableLinks (38)

HTML, RTF and Word only. Converts source and target fields of hypertext links to appropriate marked text fields.
txEnableHighlights (39)

RTF only. Converts all '\cbN' keywords into marked text fields of the type txFieldHighlight.
txEnableTopics (40)

RTF only. Converts all '\sect' keywords into marked text fields of the type txFieldTopic.
txAuthor (41)

Loads or saves the author of the document. After a document has been loaded, this property returns the author contained in the document, or an empty string if the document does not contain an author.
txCreationDate (42)

Loads or saves the creation date of the document. After a document has been loaded, this property returns the creation date contained in the document, or midnight, 30 December 1899, if the document does not contain a creation date. The time must be an UTC time (Coordinated Universal Time).
txDocKeywords (43)

Loads or saves the keywords contained in the document. The string can contain several keywords which must be separated with 09 (TAB) control characters. After a document has been loaded, this property returns the keywords contained in the document, or an empty string, if the document does not contain keywords.
txLastModificationDate (44)

Loads or saves the date of last modification. After a document has been loaded, this property returns the date of last modification contained in the document, or midnight, 30 December 1899, if the document does not contain such a date. The time must be an UTC time (Coordinated Universal Time).
txDocSubject (45)

Loads or saves the subject of the document. After a document has been loaded, this property returns the subject contained in the document, or an empty string if the document does not contain a subject.
txCreatorApplication (46)

Loads or saves the creator application of the document. After a document has been loaded, this property returns the creator application contained in the document, or an empty string if the document does not contain a creator application.
txLinkColor (50)

HTML only. Defines a text color for pieces of text which function as hypertext links. This attribute is only used when a document is loaded. When the txOverwriteLinkColor attribute is set to True, this color is used to color hypertext links. Otherwise when not set to overwrite, this color is only used when no color for links is specified in the document.
txOverwriteLinkColor (51)

HTML only. Sets the txLinkColor attribute to overwrite or not to overwrite.
txUnderlineLinks (52)

HTML only. Specifies whether or not hypertext links are underlined. This attribute is only used when a document is loaded. When set to False, hypertext links are only underlined when specified in the document.

Data Types

txDocWidth | Long
txDocHeight | Long
txDocLeftMargin | Long
txDocTopMargin | Long
txDocRightMargin | Long
txDocBottomMargin | Long
txDocTitle | String
txDocBkColor | Long
txCSSFile | String
txCSSSaveMode | Integer
txDocAccessPermissions | Long
txMasterPassword | String
txUserPassword | String
txImageCompressionQuality | Integer
txImageMaxResolution | Integer
txLoadMSWordFields | Boolean
txLoadHighEditFields | Boolean
txMSWordFieldTypeNames | String
txImageSaveMode | Integer
txImageExportFormat | Integer
txCertificateFileName | String
txCertificatePassword | String
txTimeServerURL | String
txDocumentLevelJavaScriptActions | String
txAbsPath | String
txBasePath | String
txBaseFontSize | Integer
txPropFontName | String
txMonoFontName | String
txTextColor | Long
txOverwriteTextColor | Boolean
txTextBkColor | Long
txOverwriteTextBkColor | Boolean
txLoadImages | Boolean
txEnableLinks | Boolean
txEnableHighlights | Boolean
txEnableTopics | Boolean
txAuthor | String
txCreationDate | Date
txDocKeywords | String
txLastModificationDate | Date
txDocSubject | String
txCreatorApplication | String
txLinkColor | Long
txOverwriteLinkColor | Boolean
txUnderlineLinks | Boolean

Limitations

Run time only.

See Also

  • PDF Export
  • Load Method
  • Save Method
  • LoadFromMemory Method
  • SaveToMemory Method
  • SaveToMemoryBuffer Method
  • Programming Category: Loading, Saving and Database Support


TXTextControl.TXTextControl.LockWindowUpdate Property

Disables or reenables redrawing. This property is useful to disable redrawing when setting several properties and reenables redrawing afterwards. This avoids multiple refreshing and flickering.

Syntax

TXTextControl.LockWindowUpdate = boolean
Setting | Description
True | Redrawing is disabled.
False | (Default) Redrawing is enabled.

Data Types

Boolean.

Limitations

Run time only.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.MisspelledWordAtInputPos Property

Gets the number of the misspelled word at the current text input position. If there is no misspelled word, the next possible word is returned. If there is no misspelled word between the current input position and the end of the text, the first misspelled word is returned.

Introduced: 16.0.

Syntax

TXTextControl.MisspelledWordAtInputPos

Data Types

Long.

Limitations

Read only, run time only.

See Also

  • Programming Category: Spell Checking


TXTextControl.TXTextControl.MisspelledWordDelete Method

Removes the specified misspelled word from a Text Control document. The method removes the word's reference in the list of misspelled words, but not the word's text in the document. If text is specified, this text replaces the word's text.

Introduced: 16.0.

Syntax

TXTextControl.MisspelledWordDelete Number, CorrectedText
Parameter | Description
Number | Specifies the number of the misspelled word to remove. All misspelled words are counted from the beginning to the end of a document. The first word has the number 1.
CorrectedText | Specifies corrected text. The current text of the word is replaced with this text. If an empty string is specified, the word's text remains the same.

Return Value

The method returns True when the operation could be performed, otherwise it returns False.

Data Types

Number: | Long
CorrectedText: | String
Return value: | Boolean

See Also

  • Programming Category: Spell Checking


TXTextControl.TXTextControl.MisspelledWordLength Property

Gets the length of the misspelled word with the specified number. To select this misspelled word the MisspelledWordStart property must be assigned to the SelStart property and this property must be assigned to the SelLength property.

Introduced: 16.0.

Syntax

TXTextControl.MisspelledWordLength(Number)
Parameter | Description
Number | Specifies the number of the misspelled word. All misspelled words are counted from the beginning to the end of a document. The first word has the number 1.

Data Types

Number: | Long
Property value: | Long

Limitations

Read only, run time only.

See Also

  • Programming Category: Spell Checking


TXTextControl.TXTextControl.MisspelledWords Property

Gets the current number of misspelled words.

Introduced: 16.0.

Syntax

TXTextControl.MisspelledWords

Data Types

Long.

Limitations

Read only, run time only.

See Also

  • Programming Category: Spell Checking


TXTextControl.TXTextControl.MisspelledWordStart Property

Gets the zero-based position of the misspelled word with the specified number. To select this misspelled word this property must be assigned to the SelStart property and the MisspelledWordLength property must be assigned to the SelLength property.

Introduced: 16.0.

Syntax

TXTextControl.MisspelledWordStart(Number)
Parameter | Description
Number | Specifies the number of the misspelled word. All misspelled words are counted from the beginning to the end of a document. The first word has the number 1.

Data Types

Number: | Long
Property value: | Long

Limitations

Read only, run time only.

See Also

  • Programming Category: Spell Checking


TXTextControl.TXTextControl.MouseDown Event

Occurs when the user presses a mouse button.

Syntax

TXTextControl.MouseDown(Button, Shift, X, Y)
Parameter Description
Button

Informs which button is pressed. Possible values are the following:

Value | Description
1 | The left button is pressed.
2 | The right button is pressed.
4 | The middle button is pressed.
Shift

Informs about the state of the SHIFT, CTRL and ALT keys at the time of the event. It is the sum of one or more of the following values:

Value | Description
1 | The SHIFT key was pressed at the time of the event.
2 | The CTRL key was pressed at the time of the event.
4 | The ALT key was pressed at the time of the event.
X,Y

Specifies the current location of the mouse pointer. The coordinates are relative to the upper-left corner of the Text Control.

Data Types

Button: | Integer
Shift: | Integer
X: | Long
Y: | Long

See Also

  • KeyDown Event
  • KeyUp Event
  • MouseMove Event
  • MouseUp Event
  • Programming Category: Text Selections and Character Input


TXTextControl.TXTextControl.MouseMove Event

Occurs when the user moves the mouse.

Syntax

TXTextControl.MouseMove(Button, Shift, X, Y)
Parameter Description
Button

Informs about the state of the mouse buttons at the time of the event. It is the sum of one or more of the following values:

Value | Description
1 | The left button is pressed.
2 | The right button is pressed.
4 | The middle button is pressed.
Shift

Informs about the state of the SHIFT, CTRL and ALT keys at the time of the event. It is the sum of one or more of the following values:

Value | Description
1 | The SHIFT key was pressed at the time of the event.
2 | The CTRL key was pressed at the time of the event.
4 | The ALT key was pressed at the time of the event.
X,Y

Specifies the current location of the mouse pointer. The coordinates are relative to the upper-left corner of the Text Control.

Data Types

Button: | Integer
Shift: | Integer
X: | Long
Y: | Long

See Also

  • KeyDown Event
  • KeyUp Event
  • MouseDown Event
  • MouseUp Event
  • Programming Category: Text Selections and Character Input


TXTextControl.TXTextControl.MousePointer Property

Returns or sets a value indicating the type of mouse pointer displayed when the mouse is over a particular part of a Text Control at run time.

Syntax

TXTextControl.MousePointer [= value]
Setting | Description
0 | (Default) The mouse pointer is an I-Beam in edit mode and an arrow in read-only mode. See the EditMode property for more information.
1 | Arrow.
2 | Cross.
3 | I-Beam.
4 | Icon (small square within a square).
5 | Size (four-pointed arrow).
6 | Size NE SW (double arrow pointing northeast and southwest).
7 | Size N S (double arrow pointing north and south).
8 | Size NW SE (double arrow pointing northwest and southeast).
9 | Size W E (double arrow pointing west and east).
10 | Up Arrow.
11 | Hourglass.
12 | Hand.

Data Types

Integer.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.MouseUp Event

Occurs when the user releases a mouse button.

Syntax

TXTextControl.MouseUp(Button, Shift, X, Y)
Parameter Description
Button

Informs which button is pressed. Possible values are the following:

Value | Description
1 | The left button is pressed.
2 | The right button is pressed.
4 | The middle button is pressed.
Shift

Informs about the state of the SHIFT, CTRL and ALT keys at the time of the event. It is the sum of one or more of the following values:

Value | Description
1 | The SHIFT key was pressed at the time of the event.
2 | The CTRL key was pressed at the time of the event.
4 | The ALT key was pressed at the time of the event.
X,Y

Specifies the current location of the mouse pointer. The coordinates are relative to the upper-left corner of the Text Control.

Data Types

Button: | Integer
Shift: | Integer
X: | Long
Y: | Long

See Also

  • KeyDown Event
  • KeyUp Event
  • MouseDown Event
  • MouseMove Event
  • Programming Category: Text Selections and Character Input


TXTextControl.TXTextControl.Move Event

Occurs when a Text Control has been moved with the mouse.

Syntax

Move( )

See Also

  • Size Event
  • SizeMode Property
  • Programming Category: Control Settings


TXTextControl.TXTextControl.NumberingAttribute Property

This property returns or sets attributes for numbered lists. A new attribute set with this property has only effect when the ListType Method property is used the next time.

Syntax

TXTextControl.NumberingAttribute(Attribute) [= value]
Parameter | Description
Attribute | Determines the attribute that is to be changed or returned. Possible values are listed in Constants.

Constants

Valid values for the Attribute parameter are:

Constant Description
txNumberingContinue (0)

Specifies that the current paragraph continues the numbered list if it is part of a list. To restart a list use txNumberingReStart.
txNumberingFormat (1)

Specifies the format of a numbered list. Possible values are:

Code | Meaning
3 | The list is numbered with Arabic numbers (1, 2, 3, ...).
4 | The list is numbered with small letters (a, b, c, ...).
5 | The list is numbered with capital letters (A, B, C, ...).
6 | The list is numbered with Roman numbers (I, II, III, ...).
7 | The list is numbered with small Roman numbers (i, ii, iii, ...).
txNumberingFormatChar (2)

Specifies the code of the character that defines the formatting of the gap between the number character and the following text. Possible codes are:

Code | Meaning
0 | The text immediately follows the numbering character.
9 | The text is displayed at the next tabulator position.
32 | The text follows the numbering character seperated with a space character.
txNumberingLevel (3)

Specifies the level of the numbered list. The topmost level has the number one, the maximum possible level is 10.
txNumberingPos (4)

Defines the position of the number character in twips.
txNumberingPostChar (5)

Specifies an additional character that is displayed behind the number character. This property is obsolete, the txNumberingPostText Attribute must be used instead.
txNumberingPreChar (6)

Specifies an additional character that is displayed in front of the number character. This property is obsolete, the txNumberingPreText Attribute must be used instead.
txNumberingReStart (7)

If the current paragraph is part of a numbered list, this values specifies that a new list begins. The displayed number is given through txNumberingStart. Use txNumberingContinue to continue the list.
txNumberingStart (8)

Specifies the starting number of the numbered list. For example, if this attribute is 3 and txNumberingFormat is 4 (small letters), the list starts with 'c'.
txNumberingTextPos (9)

Defines, in twips, the position of the text that follows the number character.
txNumberingPostText (10)

Specifies additional text which is displayed behind the number character. The maximum length of the text is 20 characters.
txNumberingPreText (11)

Specifies additional text which is displayed in front of the number character. The maximum length of the text is 20 characters.

Data Types

txNumberingContinue | Integer
txNumberingFormat | Integer
txNumberingFormatChar | Integer
txNumberingLevel | Integer
txNumberingPos | Integer
txNumberingPostChar | String
txNumberingPreChar | String
txNumberingReStart | Integer
txNumberingStart | Integer
txNumberingTextPos | Integer
txNumberingPostText | String
txNumberingPreText | String

Limitations

Run time only.

See Also

  • BulletAttribute Property
  • ListAttrDialog Method
  • ListType Property
  • Programming Category: Bullets and Numbered Lists


TXTextControl.TXTextControl.ObjectAttrDialog Method

This method invokes the built-in dialog box for setting attributes of images, text frames and OLE objects. The dialog box offers different options depending on the kind of object, currently selected.

Introduced: 12.0.

Syntax

TXTextControl.ObjectAttrDialog [ActiveTab]
Parameter Description
ActiveTab

Optional. Specifies the index of the tab, zero-based, that is displayed when the tabbed dialog box is opened. The following values are possible:

Value | Description
0 | The dialog box shows the tab for setting text wrapping and layout.
1 | The dialog box shows the tab for setting size and distances.
2 | The dialog box shows the tab for setting specific attributes, such as image saving options or text frame colors and frames.

Return Value

The method returns True when the user has changed one or more attibutes. The method returns False when the formatting remains unchanged.

Remarks

The changes, made in the dialog box, apply to the currently selected object.

Data Types

ActiveTab: | Integer
Return value: | Boolean

See Also

  • Programming Category: Images, Text Frames and OLE Objects
  • Programming Category: Built-in Dialog Boxes


TXTextControl.TXTextControl.ObjectChangeZOrder Method

Changes the z-order of an image, text frame or OLE object. The ObjectCurrent property determines the object.

Introduced: 18.0.

Syntax

TXTextControl.ObjectChangeZOrder ZOrder
Parameter Description
ZOrder

This parameter specifies how to change the object's z-order. Possible values are the following:

Constant | Description
txZOrderTopMost (1) | The image, text frame or OLE object is moved in front of the text at the top of all other objects.
txZOrderTop (2) | If the image, text frame or OLE object is behind the text, it becomes the topmost of all objects behind the text. If it is in front of the text, it becomes the topmost of all objects.
txZOrderUp (3) | The image, text frame or OLE object is moved up one plane. If it is the topmost object behind the text, it is not moved in front of the text.
txZOrderBottomMost (4) | The image, text frame or OLE object is moved behind the text below all other objects. This value is only possible, if the The ObjectTextflow property is 4 (behind the text).
txZOrderBottom (5) | If the image, text frame or OLE object is in front of the text, it becomes the bottommost of all objects in front of the text. If it is behind the text, it becomes the bottommost of all objects.
txZOrderDown (6) | The image, text frame or OLE object is moved down one plane. If it is the bottommost object in front of the text, it is not moved behind the text.

Return Value

The method returns True, if the z-order could be changed. The method returns False, if the object already has the specified z-order or if an error has occurred.

Data Types

ZOrder: | Integer
Return value: | Boolean

See Also

  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectClicked Event

Occurs when an object has been clicked on.

Syntax

ObjectClicked(ObjectId)
Parameter | Description
ObjectId | Is the identifier of the object that has been clicked.

Remarks

The value of the ObjectCurrent property is updated with the identifier given through the ObjectId parameter.

Data Types

ObjectId: Integer

See Also

  • ObjectDblClicked Event
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectCreated Event

This event specifies that a new object has been created. This can happen when a document that contains objects, is loaded or when an object is pasted from the clipboard. This event does not occur after inserting a new object with the ObjectInsert, ObjectInsertFixed or ObjectInsertAsChar methods.

Syntax

ObjectCreated(ObjectId)
Parameter | Description
ObjectId | Is the identifier of the object that has been created.

Remarks

The value of the ObjectCurrent property is updated with the identifier given through the ObjectId parameter.

Data Types

ObjectId: Integer

See Also

  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectCurrent Property

Returns or sets the current object for setting properties of images, text frames or OLE objects. The ImageInsert, ImageInsertAsChar, ImageInsertFixed, ObjectInsert, ObjectInsertAsChar, ObjectInsertFixed, TextFrameInsert, TextFrameInsertAsChar and TextFrameInsertFixed methods set this property internally to the newly inserted object. This property is also automatically changed when an object is clicked.

Syntax

TXTextControl.ObjectCurrent [= ObjectId]

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectDblClicked Event

Occurs when an object has been double-clicked on.

Syntax

ObjectDblClicked(ObjectId)
Parameter | Description
ObjectId | Is the identifier of the object that has been double-clicked.

Remarks

The value of the ObjectCurrent property is updated with the identifier given through the ObjectId parameter.

Data Types

ObjectId: Integer

See Also

  • ObjectClicked Event
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectDelete Method

This method deletes an image, text frame or OLE object.

Syntax

TXTextControl.ObjectDelete ObjectId
Parameter | Description
ObjectId | Is the identifier of the object to delete.

Return Value

The method returns True if the specified object could be deleted, otherwise it returns False.

Remarks

If an object is deleted from code using this method, no ObjectDeleted Event occurs.

Data Types

ObjectId: | Integer
Return value: | Boolean

See Also

  • ObjectDeleted Event
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectDeleted Event

Occurs when an object has been deleted.

Syntax

ObjectDeleted(ObjectId)
Parameter | Description
ObjectId | Is the identifier of the object that has been deleted.

Remarks

The value of the ObjectCurrent property is set to zero.

Data Types

ObjectId: Integer

See Also

  • ObjectDelete Method
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectDistance Property

Specifies the distance (in twips) between an image, text frame or OLE object and the text that flows around it. This property cannot be used for objects which are inserted as character. The ObjectCurrent property determines the object.

Syntax

TXTextControl.ObjectDistance(index) [= value]
Parameter | Description
index | Specifies one of the four possible distances: left (1), top (2), right (3), bottom (4).

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectGetData Event

Occurs when a document which contains objects, is saved. This event is sent only for objects that have been inserted via its hWnd property. In response to this event, the application can store the object's data by copying it into the ObjectData parameter.

Syntax

ObjectGetData(ObjectId, ObjectData)
Parameter | Description
ObjectId | Is the identifier of the object that is to be saved.
ObjectData | The object's private data can be copied to this parameter.

Remarks

It is recommended to store binary data as a byte array and not as a string.

Data Types

ObjectId: | Integer
ObjectData: | Variant

See Also

  • ObjectSetData Event
  • ObjectGethWnd Event
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectGetFromName Method

Looks for the object with the specified name. It must be a name previously set with the ObjectName property.

Introduced: 15.1.

Syntax

TXTextControl.ObjectGetFromName ObjectName
Parameter | Description
ObjectName | Specifies the name of the object.

Return Value

The method returns the object's unique programming identifier. This identifier can be used with the ObjectCurrent property to get or to alter the object's attributes.

Remarks

If there are more than one object with this name, the unique programming identifier of the first found object is returned.

Data Types

ObjectName: | String
Return value: | Integer

See Also

  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectGetFromUserId Method

Looks for the object with the specified user identifier. It must be an identifier previously set with the ObjectUserId property.

Introduced: 15.1.

Syntax

TXTextControl.ObjectGetFromUserId ObjectUserId
Parameter | Description
ObjectUserId | Specifies the user id of the object.

Return Value

The method returns the object's unique programming identifier. This identifier can be used with the ObjectCurrent property to get or to alter the object's attributes.

Remarks

If there are more than one object with the specified user identifier, the unique programming identifier of the first found object is returned.

Data Types

ObjectUserId: | Long
Return value: | Integer

See Also

  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectGethWnd Event

Occurs when a document which contains objects, is loaded. This event is sent only for objects that have been inserted via its hWnd property. The application must create the object and copy the object's hWnd property to the hWnd parameter.

Syntax

ObjectGethWnd(ObjectId, KindOfObject, hWnd)
Parameter | Description
ObjectId | Is the identifier of the object that is to be created.
KindOfObject | Is the value that has been specified as KindOfObject parameter for the ObjectInsertAsChar, ObjectInsert or ObjectInsertFixed method.
hWnd | The hWnd property of the new created object must be copied to this variable.

Data Types

ObjectId: | Integer
KindOfObject: | Integer
hWnd: | Handle

See Also

  • ObjectGetData Event
  • ObjectSetData Event
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectGetSelected Method

This method returns the identifier of the currently selected object. An object is selected, if a frame with size handles is drawn around the object. This method can also be used to determine whether a certain kind of object, image, text frame or OLE object, is selected.

Introduced: 12.0.

Syntax

TXTextControl.ObjectGetSelected ObjectKind
Parameter | Description
ObjectKind | This parameter specifies which kind of objects are searched. It can be a sum of the values, described in Remarks. If this parameter is zero, all objects are searched.

Return Value

The method returns the identifier of an object. It returns zero if no object of the specified kind is selected.

Remarks

The settings for ObjectKind can include:

Value | Description
&H1 | Looks only for objects positioned at a fixed geometrical position.
&H2 | Looks only for objects that act as a single character.
&H4 | Looks only for images.
&H8 | Looks only for objects which are externally created by the application.
&H10 | Looks only for OLE objects.
&H20 | Looks only for text frames.
&H40 | Looks only for objects that are anchored to a paragraph.

Data Types

ObjectKind: | Integer
Return value: | Integer

See Also

  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectGetZoom Event

Occurs when an object's zoom factor is requested. This event is sent only for objects that have been inserted via their hWnd property.

Syntax

ObjectGetZoom(ObjectId, ZoomFactor)
Parameter | Description
ObjectId | Is the identifier of the object, the zoom factor of which is requested.
ZoomFactor | The zoom factor of the object must be copied to this variable.

Data Types

ObjectId: | Integer
ZoomFactor: | Integer

See Also

  • ObjectSetZoom Event
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectHeight Property

Returns or sets the natural height, in twips, of an image, text frame or OLE object. For images this property is read only because the image data determine the height. The ObjectCurrent property determines the object.

Introduced: 12.0.

Syntax

TXTextControl.ObjectHeight

Data Types

Integer.

Limitations

Read only for images, run time only.

See Also

  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectInsert Method

This method inserts a new OLE object or other control anchored to a paragraph. The inserted object is then moved with the text.

Introduced: 12.0.

Syntax

TXTextControl.ObjectInsert ObjectType, FileName, TextPos, Alignment, PosX, PosY, ScaleX, ScaleY, TextFlow, DistanceL, DistanceT, DistanceR, DistanceB[, KindOfObject]
Parameter Description
ObjectType

Specifies the type of object. It can be one of the following identifiers:

Value | Description
1 - OLE object | Inserts an OLE object. The type of object can be selected with the system embedded OLE Insert dialog box.
2 - OLE object (programmatic identifier) | Creates a newly created OLE object. In this case, the FileName parameter must specify a string which is the programmatic identifier of the OLE object to insert.The programmatic identifier is stored under the ProgID key in the registration database.
3 - OLE object (embedded) | Inserts a newly created embedded OLE object from a file. In this case, the FileName parameter must specify a valid filename.
4 - OLE object (linked) | Inserts a newly created linked OLE object from a file. In this case, the FileName parameter must specify a valid filename.
Otherwise | Specifies a handle to a control that can be obtained with a control's hWnd property. In this case the FileName parameter must be set to zero.
FileName

The meaning of this parameter depends on the object that is to be inserted. See the description of the ObjectType parameter. This parameter can be zero, if the ObjectType parameter specifies a handle to a control.
TextPos

Specifies a text position in the paragraph where the object should be inserted. If TextPos is -1, the object is anchored to the paragraph at the current input position.
Alignment

Specifies the object's horizontal alignment. It can be one of the following values:

Value | Description
0 | The horizontal position is given through the PosX parameter.
1 | The object is left aligned relative to the paragraph to which it is anchored.
2 | The object is right aligned relative to the paragraph to which it is anchored.
3 | The object is centered relative to the paragraph to which it is anchored.
PosX

Specifies the object's horizontal position in twips relative to the left border of the paragraph. This value is used, if the Alignment parameter has been set to 0.
PosY

Specifies the object's vertical position in twips relative to the top border of the paragraph.
ScaleX

Specifies a horizontal scaling factor as a percentage.
ScaleY

Specifies a vertical scaling factor as a percentage.
TextFlow

Specifies how text flows around the image or object. It can be one of the following values:

Value | Description
2 | The text stops at the top and continues at the bottom of the object.
3 | The text flows around the object and empty areas at the left and right side are filled.
DistanceL, DistanceT, DistanceR, DistanceB

Specifies distances, in twips, between the image or object and the text.
KindOfObject

Optional. Specifies an identifier for controls that are not OLE objects. If a document is loaded which contains such controls, an ObjectGethWnd event occurs for each control to give an application the opportunity of recreating these controls. This parameter can be used to handle groups of different control types, like buttons or checkboxes.

Return Value

The method returns the object's identifier when an object could be inserted. Otherwise, it returns zero. The object's identifier can also be obtained with the ObjectCurrent property.

Data Types

ObjectType: | Handle
FileName: | String
TextPos: | Long
Alignment: | Integer
PosX: | Long
PosY: | Long
ScaleX: | Integer
ScaleY: | Integer
TextFlow: | Integer
DistanceL: | Integer
DistanceT: | Integer
DistanceR: | Integer
DistanceB: | Integer
KindOfObject: | Integer
Return value: | Integer

See Also

  • ObjectInsertFixed Method
  • ObjectInsertAsChar Method
  • Object attribute properties
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectInsertAsChar Method

This method inserts a new OLE object or other control which is then handled like a single character in the text.

Syntax

TXTextControl.ObjectInsertAsChar ObjectType, FileName, TextPos, ScaleX, ScaleY, ImageDisplayMode, ImageSaveMode [,KindOfObject]
Parameter Description
ObjectType

Specifies the type of object. It can be one of the following identifiers:

Value | Description
1 - OLE object | Inserts an OLE object. The type of object can be selected with the system embedded OLE Insert dialog box.
2 - OLE object (programmatic identifier) | Creates a newly created OLE object. In this case, the FileName parameter must specify a string which is the programmatic identifier of the OLE object to insert.The programmatic identifier is stored under the ProgID key in the registration database.
3 - OLE object (embedded) | Inserts a newly created embedded OLE object from a file. In this case, the FileName parameter must specify a valid filename.
4 - OLE object (linked) | Inserts a newly created linked OLE object from a file. In this case, the FileName parameter must specify a valid filename.
Otherwise | Specifies a handle to a control that can be obtained with a control's hWnd property. In this case the FileName parameter must be set to zero.
FileName

The meaning of this parameter depends on the object that is to be inserted. See the description of the ObjectType parameter. This parameter must be zero if the ObjectType parameter specifies a handle to a control.
TextPos

Specifies the text position where to insert the object. If TextPos is -1, the object is inserted at the current input position.
ScaleX

Specifies a horizontal scaling factor as a percentage.
ScaleY

Specifies a vertical scaling factor as a percentage.
ImageDisplayMode

This parameter is obsolete and must be set to zero.
ImageSaveMode

This parameter is obsolete and must be set to zero.
KindOfObject

Optional. Specifies an identifier for controls that are not OLE objects. If a document is loaded which contains such controls, an ObjectGethWnd event occurs for each control to give an application the opportunity of recreating these controls. This parameter can be used to handle groups of different control types, like buttons or checkboxes.

Return Value

The method returns the object's identifier when an object could be inserted. Otherwise it returns zero. The object's identifier can also be obtained with the ObjectCurrent property.

Data Types

ObjectType: | Handle
FileName: | String
TextPos: | Long
ScaleX: | Integer
ScaleY: | Integer
ImageDisplayMode: | Integer
ImageSaveMode: | Integer
KindOfObject: | Integer
Return value: | Integer

See Also

  • ObjectInsert Method
  • ObjectInsertFixed Method
  • Object attribute properties
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectInsertFixed Method

This method inserts a new OLE object or other control at a fixed geometrical position. The text flows around the object.

Syntax

TXTextControl.ObjectInsertFixed ObjectType, FileName, PosX, PosY, ScaleX, ScaleY, ImageDisplayMode, ImageSaveMode, SizeMode, TextFlow, DistanceL, DistanceT, DistanceR, DistanceB[, KindOfObject]
Parameter Description
ObjectType

Specifies the type of object. It can be one of the following identifiers:

Value | Description
1 - OLE object | Inserts an OLE object. The type of object can be selected with the system embedded OLE Insert dialog box.
2 - OLE object (programmatic identifier) | Creates a newly created OLE object. In this case, the FileName parameter must specify a string which is the programmatic identifier of the OLE object to insert.The programmatic identifier is stored under the ProgID key in the registration database.
3 - OLE object (embedded) | Inserts a newly created embedded OLE object from a file. In this case, the FileName parameter must specify a valid filename.
4 - OLE object (linked) | Inserts a newly created linked OLE object from a file. In this case, the FileName parameter must specify a valid filename.
Otherwise | Specifies a handle to a control that can be obtained with a control's hWnd property. In this case the FileName parameter must be set to zero.
FileName

The meaning of this parameter depends on the object that is to be inserted. See the description of the ObjectType parameter. This parameter must be zero, if the ObjectType parameter specifies a handle to a control.
PosX

Specifies the object's horizontal position in twips relative to the left border of the page.
PosY

Specifies the object's vertical position in twips relative to the top of the first page.
ScaleX

Specifies a horizontal scaling factor as a percentage.
ScaleY

Specifies a vertical scaling factor as a percentage.
ImageDisplayMode

This parameter is obsolete and must be set to zero.
ImageSaveMode

This parameter is obsolete and must be set to zero.
SizeMode

Specifies whether the image or object can be moved and/or sized. See the ObjectSizeMode property for possible values.
TextFlow

Specifies how text flows around the image or object. It can be one of the following values:

Value | Description
2 | The text stops at the top and continues at the bottom of the object.
3 | The text flows around the object and empty areas at the left and right side are filled.
DistanceL, DistanceT, DistanceR, DistanceB

Specifies distances, in twips, between the image or object and the text.
KindOfObject

Optional. Specifies an identifier for controls that are not OLE objects. If a document is loaded which contains such controls, an ObjectGethWnd event occurs for each control to give an application the opportunity of recreating these controls. This parameter can be used to handle groups of different control types, like buttons or checkboxes.

Return Value

The method returns the object's identifier when an object could be inserted. Otherwise, it returns zero. The object's identifier can also be obtained with the ObjectCurrent property.

Data Types

ObjectType: | Handle
FileName: | String
PosX: | Long
PosY: | Long
ScaleX: | Integer
ScaleY: | Integer
ImageDisplayMode: | Integer
ImageSaveMode: | Integer
SizeMode: | Integer
TextFlow: | Integer
DistanceL: | Integer
DistanceT: | Integer
DistanceR: | Integer
DistanceB: | Integer
KindOfObject: | Integer
Return value: | Integer

See Also

  • ObjectInsert Method
  • ObjectInsertAsChar Method
  • Object attribute properties
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectInsertionMode Property

Gets or sets an image's, text frame's or OLE object's formatting behaviour. The property's value must be a member of the ObjectInsertionModeConstants enumeration. The ObjectCurrent property determines the object.

Introduced: 15.1.

Syntax

TXTextControl.ObjectInsertionMode [= value]
Value | Description
txAsCharacter (1) | The image, text frame or OLE object is treated in the text like a single character. Objects with this behaviour can be inserted with the ImageInsertAsChar, TextFrameInsertAsChar or ObjectInsertAsChar method.
txAnchoredToParagraph (2) | The image, text frame or OLE object is anchored to a paragraph, which means that it is moved with the paragraph it is anchored to. Text can either flow around or is continued below the object depending on the ObjectTextflow property. Objects with this behaviour can be inserted with the ImageInsert, TextFrameInsert or ObjectInsert method.
txFixedOnPage (3) | The image, text frame or OLE object is positioned at a fixed geometric position of the document. Text can either flow around or is continued below the object depending on the ObjectTextflow property. Objects with this behaviour can be inserted with the ImageInsertFixed, TextFrameInsertFixed or ObjectInsertFixed method.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectItem Property

Returns a reference to an OLE object. The ObjectCurrent property determines the object.

Syntax

TXTextControl.ObjectItem

Data Types

Object.

Limitations

Read only, run time only.

Example

The following Basic example inserts a Text Control into another Text Control at the current input position and sets the font bold attribute for the inserted Text Control. The ObjectInsertAsChar method implicitely sets the ObjectCurrent property to the just inserted object.

TXTextControl1.ObjectInsertAsChar 2, "TIS.TX.TextControl.24", -1,
100, 100, 0, 0
TXTextControl1.ObjectItem.FontBold = True

See Also

  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectMoved Event

Occurs if an image, text frame or OLE object has been moved with the built-in mouse interface.

Syntax

ObjectMoved(ObjectId)
Parameter | Description
ObjectId | Is the identifier of the object that has been moved.

Data Types

ObjectId: Integer

See Also

  • ObjectSized Event
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectName Property

Defines a name for an image, text frame or OLE object. If a name already exists, the old name is deleted. The ObjectCurrent property determines the object which name is set.

Introduced: 15.1.

Syntax

TXTextControl.ObjectName [= string]

Data Types

String.

Limitations

Run time only.

See Also

  • ObjectCurrent Property
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectNext Method

This method returns the identifier of the object that follows the specified object in a Text Control's internal list of objects.

Syntax

TXTextControl.ObjectNext ObjectId, ObjectGroup
Parameter | Description
ObjectId | Specifies a valid object identifier. If this parameter is zero, the first object's identifier is returned.
ObjectGroup | This parameter specifies which kinds of objects are to be returned. It can be a sum of the values as described in Remarks. If this parameter is zero, the identifiers of all objects are returned.

Return Value

The method returns the next object's identifier. It returns zero when there is no following object.

Remarks

The settings for ObjectGroup can include:

Value | Description
&H1 | Returns only identifiers of objects positioned at a fixed geometrical position.
&H2 | Returns only identifiers of objects that act as single characters.
&H4 | Returns only identifiers of images.
&H8 | Returns only identifiers of objects which are externally created by the application.
&H10 | Returns only identifiers of OLE objects.
&H20 | Returns only identifiers of text frames.
&H40 | Returns only identifiers of objects that are anchored to a paragraph.

Data Types

ObjectId: | Integer
ObjectGroup: | Integer
Return value: | Integer

See Also

  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectPrint Event

Occurs when a document containing objects is printed. This event is sent only for objects that have been inserted via its hWnd property.

Syntax

ObjectPrint(ObjectId, Device, Left, Top, Right, Bottom, Processed)
Parameter | Description
ObjectId | Is the identifier of the object that is to be printed.
Device | Is the printer device context.
Left, Top, Right, Bottom | Is the object's bounding rectangle. This rectangle is given in device pixels with an origin at the upper left corner of the object.
Processed | When the object has been printed, this parameter should be set to True.

Data Types

ObjectId: | Integer
Device: | Long
Left, Top, Right, Bottom: | Long
Processed: | Boolean

See Also

  • ObjectGetData Event
  • ObjectSetData Event
  • ObjectGethWnd Event
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectPosX Property

Gets or sets the imags's, text frame's or OLE object's horizontal position, in twips. The ObjectCurrent property determines the object. If the object is anchored to a paragraph, the position is relative to left border of the paragraph. Otherwise, it is relative to the left edge of a page. If the object has a horizontal alignment or if it is inserted as character, this property returns zero. This property cannot be used with objects which are inserted as character.

Introduced: 15.1.

Syntax

TXTextControl.ObjectPosX [= value]

Data Types

Integer.

Limitations

Run time only.

See Also

  • ObjectPosY Property
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectPosY Property

Gets or sets the image's, text frame's or OLE object's vertical position, in twips. The ObjectCurrent property determines the object. If the object is anchored to a paragraph, the position is relative to the top of the paragraph. Otherwise, it is relative to the top of the document. If the object is inserted as character, this property returns zero. This property cannot be used with objects which are inserted as character.

Introduced: 15.1.

Syntax

TXTextControl.ObjectPosY [= value]

Data Types

Integer.

Limitations

Run time only.

See Also

  • ObjectPosX Property
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectRightClicked Event

Occurs when an object has been clicked on with the right mouse button.

Introduced: 12.0.

Syntax

ObjectRightClicked(ObjectId)
Parameter | Description
ObjectId | Is the identifier of the object that has been clicked.

Remarks

The value of the ObjectCurrent property is updated with the identifier given through the ObjectId parameter.

Data Types

ObjectId: Integer

See Also

  • ObjectClicked Event
  • ObjectDblClicked Event
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectScaleX Property

Specifies the object's horizontal scaling factor as a percentage. The ObjectCurrent property determines the object. This property cannot be used with text frames.

Syntax

TXTextControl.ObjectScaleX [= value]

Data Types

Integer.

Limitations

Run time only.

See Also

  • ObjectScaleY Property
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectScaleY Property

Specifies the object's vertical scaling factor as a percentage. The ObjectCurrent property determines the object. This property cannot be used with text frames.

Syntax

TXTextControl.ObjectScaleY [= value]

Data Types

Integer.

Limitations

Run time only.

See Also

  • ObjectScaleX Property
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectScrollOut Event

Occurs when an object is scrolled out of the visible area.

Syntax

ObjectScrollOut(ObjectId)
Parameter | Description
ObjectId | Is the identifier of the object that has been scrolled.

Data Types

ObjectId: Integer

See Also

  • ObjectMoved Event
  • ObjectSized Event
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectSetData Event

Occurs when a document which contains objects, is loaded. This event is sent only for objects that have been inserted via its hWnd property.

Syntax

ObjectSetData(ObjectId, ObjectData)
Parameter | Description
ObjectId | Is the identifier of the object that is loaded.
ObjectData | The data of the object in the format saved with the ObjectGetData event.

Data Types

ObjectId: | Integer
ObjectData: | Variant

See Also

  • ObjectGetData Event
  • ObjectGethWnd Event
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectSetZoom Event

Occurs when an object's zoom factor is to be changed. This event is sent only for objects that have been inserted via its hWnd property.

Syntax

ObjectSetZoom(ObjectId, ZoomFactor, Processed)
Parameter | Description
ObjectId | Is the identifier of the object, the zoom factor of which is to be changed.
ZoomFactor | Is the object's new zoom factor.
Processed | If the event is being processed this parameter should be set to True.

Data Types

ObjectId: | Integer
ZoomFactor: | Integer
Processed: | Boolean

See Also

  • ObjectGetZoom Event
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectSized Event

Occurs if an image, text frame or OLE object has been resized with the built-in mouse interface.

Syntax

ObjectSized(ObjectId)
Parameter | Description
ObjectId | Is the identifier of the object that has been sized.

Data Types

ObjectId: Integer

See Also

  • ObjectMoved Event
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectSizeMode Property

Specifies whether an inserted image, text frame or OLE object can be moved or resized at run time. If the Moveable option is selected, the object can be moved on the background. If the Sizeable option is selected, the borders of the object can be dragged. Images and OLE objects can be moved after clicking elsewhere on the image or object, text frames can be moved after clicking on the frame. If an object is clicked resize handles appear to indicate that this object is currently selected. The ObjectCurrent property determines the object.

Syntax

TXTextControl.ObjectSizeMode [= value]
Setting | Description
0 - Fixed | (Default) The object cannot be moved or sized.
1 - Moveable | The object can be moved.
2 - Sizeable | The object can be sized.
3 - Move and Sizeable | The object can be moved and sized.

Data Types

Integer.

Limitations

Run time only.

See Also

  • ObjectMoved Event
  • ObjectSized Event
  • SizeMode Property
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectTextflow Property

Gets or sets a value in which way text flows around an image, text frame or OLE object. The ObjectCurrent property determines the object.

Syntax

TXTextControl.ObjectTextflow [= value]
Parameter | Description
0 | Get only: The object is inserted 'as character'. To change the object's mode how it is inserted in the text, the ObjectInsertionMode property must be used.
1 | The object is in front of the text, which means that the object overwrites the text.
2 | The text stops at the top and continues at the bottom of the object.
3 | The text flows around the object and empty areas at the left and right side are filled.
4 | The object is behind the text, which means the text overwrites the object.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectTransparency Property

Specifies the object's transparency. It must be a value between 0 and 255. Zero means opaque and 255 means completely transparent. The ObjectCurrent property determines the object. This property can only be used with text frames.

Introduced: 18.0.

Syntax

TXTextControl.ObjectTransparency [= value]

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectUserId Property

Defines a user-defined identifier for an image, text frame or OLE object. If an identifer already exists, the old one is deleted. The ObjectCurrent property determines the object which identifier is set.

Introduced: 15.1.

Syntax

TXTextControl.ObjectUserId [= id]

Data Types

Long.

Limitations

Run time only.

See Also

  • ObjectCurrent Property
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.ObjectWidth Property

Returns or sets the natural width, in twips, of an image, text frame or OLE object. For images this property is read only because the image data determine the width. The ObjectCurrent property determines the object.

Introduced: 12.0.

Syntax

TXTextControl.ObjectWidth

Data Types

Integer.

Limitations

Read only for images, run time only.

See Also

  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.PageBorderAttribute Property

This property returns or sets page border attributes for the whole document or for a document's section. The SectionCurrent property determines the part of the document.

Introduced: 17.0.

Syntax

TXTextControl.PageBorderAttribute(Attribute) [= value]
Parameter | Description
Attribute | Determines the attribute that is to be changed or returned. Possible values are listed in Constants.

Constants

Valid values for the Attribute parameter are:

Constant | Description
txPageBorderLeftBorderWidth (1) | Specifies the width of the page border's left line, in twips. It is zero, if the line is not visible.
txPageBorderTopBorderWidth (2) | Specifies the width of the page border's top line, in twips. It is zero, if the line is not visible.
txPageBorderRightBorderWidth (3) | Specifies the width of the page border's right line, in twips. It is zero, if the line is not visible.
txPageBorderBottomBorderWidth (4) | Specifies the width of the page border's bottom line, in twips. It is zero, if the line is not visible.
txPageBorderLeftDistance (5) | Gets or sets the distance, in twips, of the left border line either from the edge of the page or from the text, depending on the MeasureFromText attribute.
txPageBorderTopDistance (6) | Gets or sets the distance, in twips, of the top border line either from the edge of the page or from the text, depending on the MeasureFromText attribute.
txPageBorderRightDistance (7) | Gets or sets the distance, in twips, of the right border line either from the edge of the page or from the text, depending on the MeasureFromText attribute.
txPageBorderBottomDistance (8) | Gets or sets the distance, in twips, of the bottom border line either from the edge of the page or from the text, depending on the MeasureFromText attribute.
txPageBorderLeftBorderColor (9) | Gets or sets the color of the left border line.
txPageBorderTopBorderColor (10) | Gets or sets the color of the top border line.
txPageBorderRightBorderColor (11) | Gets or sets the color of the right border line.
txPageBorderBottomBorderColor (12) | Gets or sets the color of the bottom border line.
txPageBorderOmitFirstPage (13) | Gets or sets a value indicating whether the page border is not drawn on the first page of the section.
txPageBorderFirstPageOnly (14) | Gets or sets a value indicating whether the page border is drawn only on the first page of the section.
txPageBorderSurroundHeader (15) | Gets or sets a value indicating whether the page border surrounds the section's header.
txPageBorderSurroundFooter (16) | Gets or sets a value indicating whether the page border surrounds the section's footer.
txPageBorderMeasureFromText (17) | Gets or sets a value indicating whether the page border's distances are measured from the text.

Data Types

txPageBorderLeftBorderWidth | Integer
txPageBorderTopBorderWidth | Integer
txPageBorderRightBorderWidth | Integer
txPageBorderBottomBorderWidth | Integer
txPageBorderLeftDistance | Integer
txPageBorderTopDistance | Integer
txPageBorderRightDistance | Integer
txPageBorderBottomDistance | Integer
txPageBorderLeftBorderColor | Long
txPageBorderTopBorderColor | Long
txPageBorderRightBorderColor | Long
txPageBorderBottomBorderColor | Long
txPageBorderOmitFirstPage | Boolean
txPageBorderFirstPageOnly | Boolean
txPageBorderSurroundHeader | Boolean
txPageBorderSurroundFooter | Boolean
txPageBorderMeasureFromText | Boolean

Limitations

Run time only.

See Also

  • SectionCurrent Property
  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.PageBreakBefore Property

If this property is set to true for a paragraph, it is always displayed on top of a page. The property sets the value for all paragraphs currently selected.

Introduced: 13.0.

Syntax

TXTextControl.PageBreakBefore [= boolean]

Remarks

The property returns false when the text selection contains multiple paragraphs with mixed setting.

Data Types

Boolean.

Limitations

Run time only.

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.PageChanged Event

Occurs when the text input position has been moved to another page.

Introduced: 14.0.

Syntax

PageChanged( )

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.PageCount Property

Returns the number of pages, the document contains. An empty document has at least one page.

Introduced: 22.0.

Syntax

TXTextControl.PageCount

Data Types

Long.

Limitations

Read only, run time only.

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.PageFormatChange Event

Occurs when the page format settings have been changed.

Syntax

PageFormatChange( )

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.PageHeight Property

Returns or sets the height of the page for the whole document or for a document's section. The SectionCurrent property determines the part of the document. The property returns -1, if more than one section is specified through the SectionCurrent property and these sections' pages have a different height.

Syntax

TXTextControl.PageHeight [= value]

Remarks

The height of the actual printed area is PageHeight minus PageMarginB minus PageMarginT. The maximum value depends on the capabilities of the selected printer and must not exceed 32767 twips.

Data Types

Long.

Example

See PrintPage method example.

See Also

  • PageWidth Property
  • PageMarginx Properties
  • PrintDevice Property
  • PrintPage Method
  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.PageImage Property

Returns an image of the specified page which can be used with the Picture property of a Form object, PictureBox control or Image control.

Introduced: 16.0.

Syntax

TXTextControl.PageImage Number, Content
Parameter | Description
Number | Specifies the page's number. The first page has the number 1.
Content | Specifies the image's contents. Possible values are listed in Constants. These values can be combined.

Constants

Valid values for the Content parameter are:

Constant | Description
pcBackground (1) | The image contains the background of the page.
pcHeadersAndFooters (2) | The image contains the header and the footer of the page.
pcMainText (4) | The image contains the page's text contents.
pcAll (7) | The image contains all parts.

Data Types

Number: | Long
Content: | Integer
Property value: | Picture object

Limitations

Read only, run time only.

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.PageLength Property

Gets the number of characters of the page, including the page break character at the end of the page.

Introduced: 21.0.

Syntax

TXTextControl.PageLength Number
Parameter | Description
Number | Specifies the page's number. The first page has the number 1.

Data Types

Number: | Long
Property value: | Long

Limitations

Read only, run time only.

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.PageMarginB Property

Returns or sets the bottom page margin for the whole document or for a document's section. The SectionCurrent property determines the part of the document. The property returns -1, if more than one section is specified through the SectionCurrent property and these sections' margins have different values.

Syntax

TXTextControl.PageMarginB [= value]

Remarks

The maximum values depend on the setting of the PageWidth and PageHeight properties.

Data Types

Long.

See Also

  • PageHeight Property
  • PageWidth Property
  • PrintDevice Property
  • PrintPage Method
  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.PageMarginL Property

Returns or sets the left page margin for the whole document or for a document's section. The SectionCurrent property determines the part of the document. The property returns -1, if more than one section is specified through the SectionCurrent property and these sections' margins have different values.

Syntax

TXTextControl.PageMarginL [= value]

Remarks

The maximum values depend on the setting of the PageWidth and PageHeight properties.

Data Types

Long.

See Also

  • PageHeight Property
  • PageWidth Property
  • PrintDevice Property
  • PrintPage Method
  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.PageMarginR Property

Returns or sets the right page margin for the whole document or for a document's section. The SectionCurrent property determines the part of the document. The property returns -1, if more than one section is specified through the SectionCurrent property and these sections' margins have different values.

Syntax

TXTextControl.PageMarginR [= value]

Remarks

The maximum values depend on the setting of the PageWidth and PageHeight properties.

Data Types

Long.

See Also

  • PageHeight Property
  • PageWidth Property
  • PrintDevice Property
  • PrintPage Method
  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.PageMarginT Property

Returns or sets the top page margin for the whole document or for a document's section. The SectionCurrent property determines the part of the document. The property returns -1, if more than one section is specified through the SectionCurrent property and these sections' margins have different values.

Syntax

TXTextControl.PageMarginT [= value]

Remarks

The maximum values depend on the setting of the PageWidth and PageHeight properties.

Data Types

Long.

See Also

  • PageHeight Property
  • PageWidth Property
  • PrintDevice Property
  • PrintPage Method
  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.PageOrientation Property

Returns or sets the page orientation, portrait or landscape. The SectionCurrent property determines the section or another part of the document.

Introduced: 14.0.

Syntax

TXTextControl.PageOrientation [= value]
Setting | Description
0 - Portrait | The page orientation is portrait.
1 - Landscape | The page orientation is landscape.
2 - Different values | Get only. The property returns 2, if more than one section is specified through the SectionCurrent property and these sections have different settings.

Data Types

Integer.

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.PageSelect Method

This method can be used to select the specified page.

Introduced: 21.0.

Syntax

TXTextControl.PageSelect Number
Parameter | Description
Number | Specifies the page's number. The first page has the number 1.

Return Value

The return value is True, if the specified page could be selected. Otherwise, it is False. False is returned, if the specified page does not exist.

Data Types

Number: | Long
Return value: | Boolean

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.PageStart Property

Gets the number (one-based) of the page's first character.

Introduced: 21.0.

Syntax

TXTextControl.PageStart Number
Parameter | Description
Number | Specifies the page's number. The first page has the number 1.

Data Types

Number: | Long
Property value: | Long

Limitations

Read only, run time only.

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.PageWidth Property

Returns or sets the width of the page for the whole document or for a document's section. The SectionCurrent property determines the part of the document. The property returns -1, if more than one section is specified through the SectionCurrent property and these sections' pages have a different width.

Syntax

TXTextControl.PageWidth [= value]

Remarks

The width of the actual printed area is PageWidth minus PageMarginL minus PageMarginR. The maximum value depends on the capabilities of the selected printer and must not exceed 32767 twips.

Data Types

Long.

Example

See PrintPage method example.

See Also

  • PageHeight Property
  • PageMarginx Properties
  • PrintDevice Property
  • PrintPage Method
  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.PageViewStyle Property

Defines the kind of view to display the page background. The settings have only effect, if the ViewMode property has been set to PageView.

Introduced: 14.0.

Syntax

TXTextControl.PageViewStyle [= value]
Setting | Description
txClassicColors | TThe page background color is dark gray.
txGradientColors | The page background color depends on the current system color theme settings.

Data Types

Integer.

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.ParagraphChange Event

Occurs when the character input position has been moved to another paragraph.

Syntax

ParagraphChange( )

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.ParagraphCount Property

Returns the number of paragraphs, the document contains. An empty document has at least one paragraph.

Introduced: 22.0.

Syntax

TXTextControl.ParagraphCount

Data Types

Long.

Limitations

Read only, run time only.

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.ParagraphDialog Method

Invokes the Text Control's built-in paragraph attributes dialog box and, after the user has closed the dialog box, specifies whether he has changed something.

Syntax

TXTextControl.ParagraphDialog [ActiveTab]
Parameter Description
ActiveTab

Optional. Specifies the index of the tab, zero-based, that is displayed when the tabbed dialog box is opened. The following values are possible:

Value | Description
0 | The dialog box shows the tab for setting alignment, line spacing, indentation and distances.
1 | The dialog box shows the tab for setting a frame and pagination.

Return Value

The method returns True when the user has changed one or more attibutes. The method returns False when the formatting remains unchanged.

Remarks

The changes, made in the dialog box, apply to the currently selected text.

Data Types

ActiveTab: | Integer
Return value: | Boolean

See Also

  • Programming Category: Paragraph Formatting
  • Programming Category: Built-in Dialog Boxes


TXTextControl.TXTextControl.ParagraphFormatChange Event

Occurs when the paragraph attributes of the selected paragraphs have been changed.

Syntax

ParagraphFormatChange( )

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.ParagraphSelect Method

This method can be used to select the specified paragraph.

Introduced: 22.0.

Syntax

TXTextControl.ParagraphSelect Number
Parameter | Description
Number | Specifies the paragraph's number. The first paragraph has the number 1.

Return Value

The return value is True, if the specified paragraph could be selected. Otherwise, it is False. False is returned, if the specified paragraph does not exist.

Data Types

Number: | Long
Return value: | Boolean

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.PermanentControlChars Property

Gets or sets a value specifying which control characters are shown permanently on the screen. The property's value must be one or more values of the ControlCharConstants enumeration. To specify more than one value they can be added. Control characters which are not specified through this property are shown only, when the ControlChars property has been set to True.

Introduced: 19.0.

Syntax

TXTextControl.PermanentControlChars [= value]
Value | Description
txSpace (1) | Shows a space.
txTab (2) | Shows a tabstopp.
txParagraph (4) | Shows the end of a paragraph.
txLineBreak (8) | Shows a forced line break.
txObjectAnchor (16) | Shows an anchor, when an anchored object is selected.
txPageBreak (32) | Shows a page break.
txSectionBreak (64) | Shows a section break.
txHyphen (128) | Shows a hyphen.
txNonBreakingSpace (256) | Shows a non-breaking space.
txTableCellEnd (512) | Shows the end of a table cell.
txAll (1023) | Shows all control characters.

Data Types

Integer.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.PosChange Event

Occurs when the current character input position has been changed.

Syntax

PosChange( )

See Also

  • Programming Category: Text Selections and Character Input


TXTextControl.TXTextControl.PrintColors Property

Specifies whether text colors are printed as colors or in black.

Syntax

TXTextControl.PrintColors [= booelan]
Setting | Description
True | (Default) Text colors are printed.
False | All the text is printed in black.

Data Types

Boolean.

See Also

  • Programming Category: Printing and Print Preview


TXTextControl.TXTextControl.PrintDevice Property

Sets the printer device context for TextContol's built-in printing function. The Windows operating enviroment manages devices like printers and screens with context handles.

Syntax

TXTextControl.PrintDevice [= DeviceContextHandle]

Data Types

Long.

Limitations

Write only, run time only.

See Also

  • PageHeight Property
  • PageMarginx Properties
  • PageWidth Property
  • PrintPage Method . Example: See
  • PrintPage method
  • Programming Category: Printing and Print Preview


TXTextControl.TXTextControl.PrintDialog Method

Opens the system printing dialog and prints a Text Control document as specified through the dialog. This method uses the values specified through the PrintColors, PrintZoom and PrintOffset properties.

Introduced: 19.0.

Syntax

TXTextControl.PrintDialog DocName
Parameter | Description
DocName | Specifies the name of the document used for the print job.

Return Value

This method has no return value.

Data Types

DocName String

Limitations

Needs at least Windows 2000.

See Also

  • PrintDoc Method
  • PrintPage Property
  • Programming Category: Printing and Print Preview
  • Programming Category: Built-in Dialog Boxes


TXTextControl.TXTextControl.PrintDoc Method

Prints a Text Control document or a part of a Text Control document on the default printer.

Syntax

TXTextControl.PrintDoc DocName, FirstPage, LastPage, Copies
Parameter | Description
DocName | Specifies the name of the document used for the print job.
FromPage | Specifies the first page to print.
ToPage | Specifies the last page to print.
Copies | Specifies the number of copies to print.

Return Value

This method has no return value.

Remarks

Prior to using this method the Text Control's output device can be selected using the PrintDevice property. If this property is not used Text Control prints to the printer, for which the document is currently formatted.

Data Types

DocName | String
FromPage | Integer
ToPage | Integer
Copies | Integer

See Also

  • PrintPage Method
  • PrintDevice Property
  • Programming Category: Printing and Print Preview


TXTextControl.TXTextControl.PrintOffset Property

Determines whether Text Control starts printing exactly at the top left corner of the page, or at the printer's physical printing offset.

Syntax

TXTextControl.PrintOffset [= boolean]
Setting | Description
True | Adds the physical printing offset.
False | (Default) Do not add the physical printing offset.

Data Types

Boolean.

See Also

  • Programming Category: Printing and Print Preview


TXTextControl.TXTextControl.PrintPage Method

Prints a page of text on the default printer. The number is specified through PageNumber.

Syntax

TXTextControl.PrintPage PageNumber
Parameter | Description
PageNumber | Specifies the number of the page to print. The first page has the number 1.

Return Value

This method has no return value.

Remarks

Prior to using this method the Text Control's output device must be selected using the PrintDevice property.

Data Types

PageNumber Integer

Example

This Basic example shows how to print the contents of a Text Control on the default printer:

Sub mnuFile_Print_Click ()
   Dim wPages, No
   Printer.Print
   wPages = TXTextControl1.CurrentPages
   For No = 1 To wPages
      TXTextControl1.PrintDevice = Printer.hDC
      TXTextControl1.PrintPage No
      Printer.NewPage
   Next No
   Printer.EndDoc
End Sub

See Also

  • PageHeight Property
  • PageMarginx Properties
  • PageWidth Property
  • PrintDevice Property
  • Programming Category: Printing and Print Preview


TXTextControl.TXTextControl.PrintZoom Property

Specifies a zoom factor for printing. The value is specified as a percentage in the range of 10 to 400%. This property is independent of the current ZoomFactor setting.

Syntax

TXTextControl.PrintZoom [= value]

Data Types

Integer.

See Also

  • ZoomFactor Property
  • Programming Category: Printing and Print Preview


TXTextControl.TXTextControl.Redo Method

This method can be used to redo the last Text Control operation.

Syntax

TXTextControl.Redo

Return Value

The method returns True if the redo operation was successful. Otherwise it returns False.

Data Types

Return value: Boolean

See Also

  • Undo Method
  • CanUndo Property
  • CanRedo Property
  • Programming Category: Undo


TXTextControl.TXTextControl.Refresh Method

This method forces a complete repaint of a Text Control.

Syntax

TXTextControl.Refresh

Return Value

This method has no return value.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.ResetContents Method

Deletes the complete contents of a Text Control including tables, objects, marked text fields and headers and footers.

Syntax

TXTextControl.ResetContents

Return Value

The method returns True, if everything could be deleted, otherwise it returns False.

Data Types

Return value: Boolean

See Also

  • PDF Export
  • Programming Category: Loading, Saving and Database Support


TXTextControl.TXTextControl.ResourceFile Property

Returns or sets the file name of a resource library which Text Control loads to display resources like information strings, error messages and built-in dialog boxes. The file name must include a complete path. When a resource library is set, the value of the Language property is ignored. See the chapter Technical Articles - Resources for more information. To avoid compatibility errors, resource libraries should have a unique file name and should be placed in the same directory as the application's executable file.

Syntax

TXTextControl.ResourceFile [= string]

Data Types

String.

Limitations

Run time only.

See Also

  • Language Property
  • Programming Category: Control Settings


TXTextControl.TXTextControl.RightToLeft Property

Returns or sets a value specifying whether the Text Control's vertical scrollbar is at the left or right border and whether the Text Control has a right or left zoom origin.

Introduced: 20.0.

Syntax

   TXTextControl.RightToLeft [= boolean]
Setting | Description
False | (Default) Shows the Text Control with a left to right orientation.
True | Shows the Text Control with a right to left orientation.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.RTFSelText Property

This property works much like the standard SelText property. The SelStart and SelLength properties can be used to specify a text selection which is to be copied to a string or inserted from a string. The difference between SelText and RTFSelText is that with the SelText property, text is stored without formatting information in the ANSI format, whilst RTFSelText uses Rich Text Format to preserve all of the formatting attributes.

Syntax

TXTextControl.RTFSelText [= string]

Remarks

RTF (Rich Text Format) is one of the most common interchange formats for text documents. Most word processors available for Windows are able to read and write RTF files.

Data Types

String.

Limitations

Run time only.

See Also

  • PDF Export
  • Programming Category: Loading, Saving and Database Support


TXTextControl.TXTextControl.RulerHandle Property

Specifies the ruler control to be used as horizontal ruler with a Text Control.

Syntax

TXTextControl.RulerHandle [= Ruler.hWnd]

Data Types

Handle.

Limitations

Run time only.

See Also

  • StatusBarHandle Property
  • ButtonBarHandle Property
  • VerticalRulerHandle Property
  • Programming Category: Tool Bars


TXTextControl.TXTextControl.Save Method

Saves data in a file with a specified format.

Syntax

TXTextControl.Save FileName[, Offset[, Format[, CurSelection]]]
Parameter Description
FileName

Specifies the file to save in.
Offset

Optional. Specifies the file position to where the data is to be written when the data of more than one Text Control are to be saved. When not specified or set to -1 the data is appended.
Format

Optional. Specifies a format identifier. When this parameter is not specified the data is saved in the internal Text Control format (3). Otherwise it can be one of the following values:

Constant | Description
1 - ANSI text | Text in Windows ANSI format (an end of a paragraph is marked with the control characters 13 and 10).
2 - TX text | Text in ANSI format (an end of a paragraph is marked only with the control character 10).
3 - TX | Text including formatting attributes in the internal Text Control format. Text is stored in ANSI.
4 - HTML | HTML format (Hypertext Markup Language).
5 - RTF | RTF format (Rich Text Format).
6 - Unicode text | Text in Windows Unicode format (an end of a paragraph is marked with the control characters 13 and 10).
7 - TX text | Text in Unicode format (an end of a paragraph is marked only with the control character 10).
8 - TX | Text including formatting attributes in the internal Text Control format. Text is stored in Unicode.
9 - Microsoft Word 97-2003 | Microsoft Word 97-2003 format (*.doc).
10 - XML | XML format (Extensible Markup Language).
11 - CSS | CSS format (Cascading Style Sheet).
12 - Adobe PDF | Adobe Portable Document Format (PDF).
13 - Microsoft Word | Microsoft Word format (*.docx).
14 - Adobe PDF/A | Adobe Portable Document Format Archive (PDF/A).
CurSelection

Optional. When set to True the current selection is saved. When omitted or set to False or when no selection exists all the control contents are saved. This parameter must be set to False if the saving format is XML (10) or CSS (11).

Return Value

The method returns the position in the file behind the saved data. It is zero if the data could not be saved.

Data Types

FileName: | String
Offset: | Long
Format: | Integer
CurSelection: | Boolean
Return value: | Long

See Also

  • PDF Export
  • Load Method
  • Programming Category: Loading, Saving and Database Support


TXTextControl.TXTextControl.SaveToMemory Method

Returns a one-dimensional byte array containing text data in a specified format.

Syntax

TXTextControl.SaveToMemory [Format[, CurSelection]]
Parameter | Description
Format | Optional. Specifies a format identifier. When this parameter is not specified the data is saved in the internal Text Control format (3). See the Format parameter of the Save method for possible format identifiers.
CurSelection | Optional. When set to True the current selection is saved. When omitted or set to False or when no selection exists all the control contents are saved.

Return Value

The method returns a one-dimensional array of bytes, containing the saved data.

Data Types

Format: | Integer
CurSelection: | Boolean
Return value: | One-dimensional Byte Array

Example

This Basic example copies the currently selected text from the first Text Control and inserts it at the current input position of a second Text Control:

Dim data() As Byte
data = TXTextControl1.SaveToMemory(3, True)
TXTextControl2.LoadFromMemory data, 3, True

See Also

  • PDF Export
  • Save Method
  • LoadFromMemory Method
  • Programming Category: Loading, Saving and Database Support


TXTextControl.TXTextControl.SaveToMemoryBuffer Method

Returns a buffer containing text data in a specified format. The buffer can be a string or a one-dimensional byte array. To inform Text Control which kind of buffer is to returned specify the buffer as the first parameter.

Syntax

TXTextControl.SaveToMemoryBuffer DataBuffer[, [Format[, CurSelection]]
Parameter | Description
DataBuffer | Specifies a buffer that can be a string or a byte array. Text Control uses this parameter to get the type of the return buffer.
Format | Optional. Specifies a format identifier. When this parameter is not specified the data is saved in the internal Text Control format (3). See the Format parameter of the Save method for possible format identifiers.
CurSelection | Optional. When set to True the current selection is saved. When omitted or set to False or when no selection exists all the control contents are saved.

Return Value

The method returns a buffer, containing the saved data.

Data Types

DataBuffer: | String or One-dimensional Byte Array
Format: | Integer
CurSelection: | Boolean
Return value: | Same Type as DataBuffer

Example

This Basic example copies the currently selected text from the first Text Control and inserts it at the current input position of a second Text Control using RTF format:

Dim RTF As String
RTF = TXTextControl1.SaveToMemoryBuffer(RTF, 5, True)
TXTextControl2.LoadFromMemory RTF, 5, True

See Also

  • PDF Export
  • Save Method
  • SaveToMemory Method
  • LoadFromMemory Method
  • Programming Category: Loading, Saving and Database Support


TXTextControl.TXTextControl.ScrollBars Property

Returns or sets a value indicating whether a Text Control has horizontal or vertical scroll bars. Scroll bars are automatically hidden when the formatting area is smaller than the control's visible area and vice versa. Therefore this property has only effect if the PageWidth and/or the PageHeight properties have been set to non-zero. See Technical Articles - Text Formatting and Views for more information.

Syntax

TXTextControl.ScrollBars [= value]
Setting | Description
0 | (Default) The Text Control has no scroll bars.
1 | The Text Control has a horizontal scroll bar when the page width is larger than the control's width.
2 | The Text Control has a vertical scroll bar when the page height is larger than the control's height.
3 | The Text Control has both scroll bars.

Data Types

Integer.

See Also

  • PageWidth Property
  • PageHeight Property
  • Programming Category: Scrolling


TXTextControl.TXTextControl.ScrollPosX Property

Specifies the position of the horizontal scroll bar in twips.

Syntax

TXTextControl.ScrollPosX [= value]

Data Types

Long.

Limitations

Run time only.

See Also

  • ScrollPosY Property
  • HScroll Event
  • VScroll Event
  • Programming Category: Scrolling


TXTextControl.TXTextControl.ScrollPosY Property

Specifies the position of the vertical scroll bar in twips.

Syntax

TXTextControl.ScrollPosY [= value]

Data Types

Long.

Limitations

Run time only.

See Also

  • ScrollPosX Property
  • HScroll Event
  • VScroll Event
  • Programming Category: Scrolling


TXTextControl.TXTextControl.SelectionViewMode Property

Specifies whether text selections are displayed with a transparent bitmap or through inverting the text.

Introduced: 17.0.

Syntax

TXTextControl.SelectionViewMode [= value]
Setting | Description
0 - Classic | When text is selected, this text is inverted on the screen.
1 - Transparent Bitmap | When text is selected, a transparent bitmap is used to display the selection.

Data Types

Integer.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.SectionAtInputPos Property

Returns the number of the section containing the current text input position. The first section has the number 1. If text is selected, the section at the selection's start position is returned. The start position is the side of the selection that has been last extended.

Introduced: 14.0.

Syntax

TXTextControl.SectionAtInputPos

Data Types

Integer.

Limitations

Read only, run time only.

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.SectionBreakKind Property

Returns or sets the kind of the section break the section starts with. The SectionCurrent property determines the section or another part of the document.

Introduced: 14.0.

Syntax

TXTextControl.SectionBreakKind [= value]
Setting | Description
txBeginAtNewLine | The section begins on the next line with a new paragraph.
txBeginAtNewPage | The section begins on the next page with a new paragraph.
0 | Get only. The property returns 0, if more than one section is specified through the SectionCurrent property and these sections have different settings.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.SectionChanged Event

Occurs when the text input position has been moved to another section.

Introduced: 14.0.

Syntax

SectionChanged( )

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.SectionCount Property

Returns the number of sections, the document contains. An empty document has at least one section.

Introduced: 14.0.

Syntax

TXTextControl.SectionCount

Data Types

Integer.

Limitations

Read only, run time only.

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.SectionCurrent Property

Returns or sets the section number for the following properties and methods: PageWidth, PageHeight, PageMarginL, PageMarginT, PageMarginR, PageMarginB, PageOrientation, HeaderFooter, HeaderFooterActivate, HeaderFooterSelect, HeaderFooterPosition, HeaderFooterConnectedToPrevious, Columns, PageBorderAttribute, ColumnDistance, ColumnLineWidth, ColumnLineColor, ColumnWidthsAndDistances, SectionRestartPageNumbering, and SectionBreakKind. The section number can either be the number of a section, beginning with 1, or a value specifying all sections of the document or all selected sections.

Introduced: 14.0.

Syntax

TXTextControl.SectionCurrent [= SectionNumber]
Setting | Description
0 | (Default) All sections of the document.
-1 | The section with the text input position or all selected sections.
Otherwise | The number of a section. Sections are numbered from the beginning to the end of a document beginning with 1.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.SectionFormatDialog Method

This method invokes the built-in dialog box to set page settings and to design the headers and footers either for the whole document or for a single section.

Introduced: 14.0.

Syntax

TXTextControl.SectionFormatDialog ActiveTab
Parameter Description
ActiveTab

Specifies the index of the tab, zero-based, that is displayed when the tabbed dialog box is opened. The following values are possible:

Value | Description
0 | The dialog box shows the tab for setting page margins, page size and orientation.
1 | The dialog box shows the tab for setting headers and footers.
2 | The dialog box shows the tab for setting column attributes.
3 | The dialog box shows the tab for setting page borders.

Return Value

The method returns True when the user has changed one or more attibutes. The method returns False when the formatting remains unchanged.

Data Types

ActiveTab: | Integer
Return value: | Boolean

See Also

  • Programming Category: Sections and Pages
  • Programming Category: Built-in Dialog Boxes


TXTextControl.TXTextControl.SectionInsert Method

Inserts a section break at the text input position or at a specified position.

Introduced: 14.0.

Syntax

TXTextControl.SectionInsert BreakKind, TextPos
Parameter Description
BreakKind

Specifies the kind of the section break. It can be one of the following Constants:

Value | Description
txBeginAtNewLine | The section begins on the next line with a new paragraph.
txBeginAtNewPage | The section begins on the next page with a new paragraph.
TextPos

Specifies the text position at which the section is to be inserted. If this parameter is -1, the section break is inserted at the current text input position.

Return Value

The return value is True, if the section break could be added. Otherwise it is False.

Data Types

BreakKind: | Integer
TextPos: | Long
Return value: | Boolean

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.SectionLength Property

Gets the number of characters in the section. The section break character is not included.

Introduced: 21.0.

Syntax

TXTextControl.SectionLength Number
Parameter | Description
Number | Specifies the section's number. The first section has the number 1. To get the number of the section at the text input position the SectionAtInputPos property can be used.

Data Types

Number: | Long
Property value: | Long

Limitations

Read only, run time only.

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.SectionRestartPageNumbering Property

Returns or sets a value specifying whether page numbering is restarted at the beginning of a document section. The SectionCurrent property determines the section or another part of the document.

Introduced: 19.0.

Syntax

TXTextControl.SectionRestartPageNumbering [= value]
Setting | Description
0 - Continue | Page numbering is continued from the previous section.
1 - Restart | Page numbering is restarted at the beginning of the specified section.
2 - Different values | Get only. The property returns 2, if more than one section is specified through the SectionCurrent property and these sections have different settings.

Data Types

Integer.

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.SectionSelect Method

This method can be used to select the specified section.

Introduced: 21.0.

Syntax

TXTextControl.SectionSelect Number
Parameter | Description
Number | Specifies the section's number. The first section has the number 1. To get the number of the section at the text input position the SectionAtInputPos property can be used.

Return Value

The return value is True, if the specified section could be selected. Otherwise, it is False. False is returned, if the specified section does not exist.

Data Types

Number: | Long
Return value: | Boolean

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.SectionStart Property

Gets the number (one-based) of the section's first character.

Introduced: 21.0.

Syntax

TXTextControl.SectionStart Number
Parameter | Description
Number | Specifies the section's number. The first section has the number 1. To get the number of the section at the text input position the SectionAtInputPos property can be used.

Data Types

Number: | Long
Property value: | Long

Limitations

Read only, run time only.

See Also

  • Programming Category: Sections and Pages


TXTextControl.TXTextControl.SelLength Property

Returns or sets the number of characters selected.

Syntax

TXTextControl.SelLength [= value]

Remarks

The valid range of settings is 0 to text length, the total number of characters a Text Control contains. Setting this property's value to a value larger than the current text size, extents the selection up to the document's end.

Data Types

Long.

Limitations

Run time only.

See Also

  • SelStart Property
  • SelText Property
  • Programming Category: Text Selections and Character Input


TXTextControl.TXTextControl.SelStart Property

Returns or sets the starting point of text selected or indicates the position of the insertion point if no text is selected. The first text position has a value of 0.

Syntax

TXTextControl.SelStart [= value]

Remarks

Setting the property value greater than the text length limits it to the existing text length. Setting this property to -1 will set the starting point for a selection to the documents end.

Data Types

Long.

Limitations

Run time only.

See Also

  • SelLength Property
  • SelText Property
  • Programming Category: Text Selections and Character Input


TXTextControl.TXTextControl.SelText Property

Returns or sets the string containing the currently selected text. It is a zero-length string if no characters are selected. This property can be used in conjunction with the SelStart and SelLength properties for tasks such as selecting substrings or clearing text. In conjunction with the clipboard these properties are useful for copy, cut, and paste operations.

Syntax

TXTextControl.SelText [= value]

Remarks

Setting this property to a new value sets SelLength to 0 and replaces the selected text with the new string.

Data Types

String.

Limitations

Run time only.

See Also

  • SelLength Property
  • SelStart Property
  • Programming Category: Text Selections and Character Input


TXTextControl.TXTextControl.ShrinkFont Method

Decreases the font size of each font contained in the current text selection. If no text is selected, this method decreases the font size at the text input position. The font sizes used with this method are the same as shown through the Button Bar or the built-in font dialog.

Introduced: 16.0.

Syntax

TXTextControl.ShrinkFont

Return Value

The return value is True, if at least one font size could be changed. It is False, if the minimum value has been reached.

Data Types

Return value: Boolean

See Also

  • Programming Category: Character Formatting


TXTextControl.TXTextControl.Size Event

Occurs when a Text Control has been resized with the mouse.

Syntax

Size( )

See Also

  • Move Event
  • SizeMode Property
  • Programming Category: Control Settings


TXTextControl.TXTextControl.SizeMode Property

Specifies whether the Text Control can be moved or resized at run time. If the Moveable option is selected, the control can be moved by dragging the control's frame with the mouse, after the cross cursor has been shown. If the Sizeable option is selected, the control can be resized after a resize cursor has been shown in one of the frame's corners or midpoints.

Syntax

TXTextControl.SizeMode [= value]
Setting | Description
0 - Fixed | (Default) The Text Control cannot be moved or sized.
1 - Moveable | The Text Control can be moved.
2 - Sizeable | The Text Control can be sized.
3 - Move and Sizeable | The Text Control can be moved and sized.

Data Types

Integer.

See Also

  • Move Event
  • Size Event
  • Programming Category: Control Settings


TXTextControl.TXTextControl.SpellCheckText Event

Occurs, if the document's text has been altered and the spelling of the new text must be checked. This event occurs only, if the EnableSpellChecking property has been set to true.

Introduced: 16.0.

Syntax

SpellCheckText(Text, MisspelledWordPositions)
Parameter | Description
Text | Is the text to check.
MisspelledWordPositions | Is an array of Long values which can be used to inform the TextControl about misspelled words. This array must be created in the event handler after the specified text has been examined. The array must contain two entries for each misspelled word: a start position and an end position. Both values must be one-based indices in the specified text. The example text 'This iss an exxample' contains two misspelled words: 'iss' and 'exxample'. For this example an array of four Long values must be created containing the values 6, 8, 13, 20. TextControl uses these positions to underline the misspelled words with a red zigzag line.

Data Types

Text: | String
MisspelledWordPositions: | Array of Long

See Also

  • Programming Category: Spell Checking


TXTextControl.TXTextControl.StartUndoAction Method

Defines the beginning of an undo action. It can be used, if more than one property or method call is to be defined as a single undo action. All property and/or method calls between StartUndoAction and EndUndoAction define a single undo action.

Introduced: 11.0.

Syntax

TXTextControl.StartUndoAction

See Also

  • EndUndoAction Method
  • Programming Category: Undo


TXTextControl.TXTextControl.StatusBarHandle Property

Specifies the status bar control to be used with a Text Control.

Syntax

TXTextControl.StatusBarHandle [= TXStatusBar.hWnd]

Data Types

Handle.

Limitations

Run time only.

See Also

  • ButtonBarHandle Property
  • RulerHandle Property
  • VerticalRulerHandle Property
  • Programming Category: Tool Bars


TXTextControl.TXTextControl.StyleChanged Event

Occurs after the character input position has been moved to a text part formatted with another style.

Syntax

StyleChanged( )

See Also

  • Programming Category: Stylesheet Formatting


TXTextControl.TXTextControl.StyleCurrent Property

Returns or sets the formatting style at the current input position or, if text is selected, changes all styles of the selected text to the specified style. If text is selected and formatted with several styles the property returns an empty string. A formatting style is given through its unique name.

Syntax

TXTextControl.StyleCurrent [= StyleName]

Data Types

String.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Formatting


TXTextControl.TXTextControl.StyleDialog Method

Invokes the Text Control's built-in dialog box for creating, deleting and modifying formatting styles.

Syntax

TXTextControl.StyleDialog

Return Value

The method returns True when the user has changed one or more styles. The method returns False when all styles remain unchanged.

Remarks

A StyleListChanged event occurs if styles have been deleted or if new styles have been created.

Data Types

Return value: Boolean

See Also

  • Programming Category: Stylesheet Formatting
  • Programming Category: Built-in Dialog Boxes


TXTextControl.TXTextControl.StyleListChanged Event

Occurs after one or more formatting styles have been added or removed.

Syntax

StyleListChanged( )

See Also

  • Programming Category: Stylesheet Formatting


TXTextControl.TXTextControl.Styles Property

Returns a collection of all formatting styles in a document.

Syntax

TXTextControl.Styles

Data Types

Styles Collection object.

Limitations

Read only, run time only.

See Also

  • Styles Collection
  • Style Object
  • Programming Category: Stylesheet Programming


TXTextControl.TXTextControl.SupportedFonts Property

This property returns a string specifying the names of all available fonts. The font names are separated through a '|' sign. The font names returned depend on the settings made with the FontSettings property.

Introduced: 22.0.

Syntax

TXTextControl.SupportedFonts

Data Types

String.

Limitations

Read only, run time only.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.TabCurrent Property

Specifies the current tab number for the properties TabPos and TabType.

Syntax

TXTextControl.TabCurrent [= value]

Remarks

Text Control supports up to 14 tabs for each paragraph. Valid values for this property are 1 to 14.

Text Control sorts the tabs in ascending order whenever you change the position of a tab, so a tab's number can change when it it moved. In this case, the TabCurrent Property is updated to reflect the change. Tabs outside of the paragraph are automatically set to zero.

Data Types

Integer.

Example

The first of the following Basic examples moves the first tab to a new position 1 inch from the left border and changes it to a decimal tab. The second of the following Basic examples changes all the tabs to be right-aligned at 1/2 inch gradations:

TXTextControl1.TabCurrent = 1
TXTextControl1.TabType = 4
TXTextControl1.TabPos = 1440
' Delete all tabs
for n=14 to 1 step -1
   TXTextControl1.TabCurrent = n
   TXTextControl1.TabPos = 0
next n
' Create new tabs
for n=1 to 14
   TXTextControl1.TabCurrent = n
   TXTextControl1.TabPos = n*720
   if (TXTextControl1.TabPos > 0) then _
      TXTextControl1.TabType = 2
next n

See Also

  • TabPos Property
  • TabType Property
  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.TabDialog Method

Invokes the Text Control's built-in dialog box for setting tabs.

Syntax

TXTextControl.TabDialog

Return Value

The method returns True when the user has changed one or more tabs. The method returns False when all tabs remain unchanged.

Data Types

Return value: Boolean

See Also

  • Programming Category: Paragraph Formatting
  • Programming Category: Built-in Dialog Boxes


TXTextControl.TXTextControl.TabKey Property

Determines if the keyboard's tab key moves the input focus to the next control or to insert tabulators in the Text Control's text.

Syntax

TXTextControl.TabKey [= boolean]
Setting | Description
True | (Default) Inserts a tabulator in the Text Control's text.
False | Moves the current input focus to the next control.

Data Types

Boolean.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.TableAtInputPos Property

Returns the table identifier of the table containing the input position. Zero is returned when the input position is not inside a table or when more than one table cell is selected.

Syntax

TXTextControl.TableAtInputPos

Data Types

Integer.

Limitations

Read only, run time only.

See Also

  • Tables
  • TableColAtInputPos Property
  • TableRowAtInputPos Property
  • Programming Category: Tables


TXTextControl.TXTextControl.TableAttrDialog Method

This method invokes the built-in dialog box for setting table attributes and, after the user has closed the dialog box, specifies whether he has changed something.

Syntax

TXTextControl.TableAttrDialog [ActiveTab]
Parameter Description
ActiveTab

Optional. Specifies the index of the tab, zero-based, that is displayed when the tabbed dialog box is opened. The following values are possible:

Value | Description
0 | The dialog box shows the tab for setting frame lines, color and distances.
1 | The dialog box shows the tab for setting the vertical size and alignment.

Return Value

The method returns True when the user has changed one or more attibutes. The method returns False when the formatting remains unchanged.

Remarks

The changes, made in the dialog box, apply to the currently selected text.

Data Types

ActiveTab: | Integer
Return value: | Boolean

See Also

  • Tables
  • Programming Category: Tables
  • Programming Category: Built-in Dialog Boxes


TXTextControl.TXTextControl.TableCanChangeAttr Property

This property provides information about whether the attributes of all the selected table cells can be altered. It returns False when the selection is not completely within a single table. Otherwise it returns True.

Syntax

TXTextControl.TableCanChangeAttr
Setting | Description
True | Table attributes can be altered.
False | Table attributes cannot be altered.

Data Types

Boolean.

Limitations

Read only, run time only.

See Also

  • Tables
  • TableAttrDialog Method
  • Programming Category: Tables


TXTextControl.TXTextControl.TableCanDeleteColumn Property

This property provides information about whether table columns can be deleted. It returns True if table columns can be deleted. It returns False, if the text selection is not inside a single table.

Syntax

TXTextControl.TableCanDeleteColumn

Data Types

Boolean.

Limitations

Read only, run time only.

See Also

  • Tables
  • TableDeleteColumn Method
  • Programming Category: Tables


TXTextControl.TXTextControl.TableCanDeleteLines Property

This property provides information about whether table lines can be deleted. It returns False when no table line is selected or when the current input position is outside a table. Otherwise it returns True.

Syntax

TXTextControl.TableCanDeleteLines
Setting | Description
True | Table lines can be deleted.
False | Table lines cannot be deleted.

Data Types

Boolean.

Limitations

Read only, run time only.

See Also

  • Tables
  • TableDeleteLines Method
  • Programming Category: Tables


TXTextControl.TXTextControl.TableCanInsert Property

This property provides information about whether a table can be inserted. It returns False when a selection exists or the current input position is inside a table. Otherwise it returns True.

Syntax

TXTextControl.TableCanInsert
Setting | Description
True | A new table can be inserted.
False | A new table cannot be inserted.

Data Types

Boolean.

Limitations

Read only, run time only.

See Also

  • Tables
  • TableInsert Method
  • Programming Category: Tables


TXTextControl.TXTextControl.TableCanInsertColumn Property

This property provides information about whether a table column can be inserted. It returns True if a table column can be inserted. It returns False if text is selected or if the current input position is outside a table.

Syntax

TXTextControl.TableCanInsertColumn

Data Types

Boolean.

Limitations

Read only, run time only.

See Also

  • Tables
  • TableInsertColumn Method
  • Programming Category: Tables


TXTextControl.TXTextControl.TableCanInsertLines Property

This property provides information about whether table lines can be inserted. It returns True if table lines can be inserted. It returns False if text is selected or if the current input position is outside a table.

Syntax

TXTextControl.TableCanInsertLines

Data Types

Boolean.

Limitations

Read only, run time only.

See Also

  • Tables
  • TableInsertLines Method
  • Programming Category: Tables


TXTextControl.TXTextControl.TableCanMergeCells Property

This property provides information about whether table cells can be merged. It returns True, if table cells can be merged. Table cells can only be merged, if more than one cell is selected, and if the selection is in a single table.

Introduced: 17.0.

Syntax

TXTextControl.TableCanMergeCells

Data Types

Boolean.

Limitations

Read only, run time only.

See Also

  • Tables
  • TableMergeCells Method
  • Programming Category: Tables


TXTextControl.TXTextControl.TableCanSplit Property

Checks whether a table can be split. A table can only be split, if it contains the current input position and no further text is selected.

Introduced: 11.0.

Syntax

TXTextControl.TableCanSplit

Data Types

Boolean.

Limitations

Read only, run time only.

See Also

  • Tables
  • TableSplit Method
  • Programming Category: Tables


TXTextControl.TXTextControl.TableCanSplitCells Property

This property provides information about whether table cells can be split. It returns True, if table cells can be split, otherwise it returns False.

Introduced: 17.0.

Syntax

TXTextControl.TableCanSplitCells

Data Types

Boolean.

Limitations

Read only, run time only.

See Also

  • Tables
  • TableSplitCells Method
  • Programming Category: Tables


TXTextControl.TXTextControl.TableCellAttribute Property

Returns or sets attributes of a table cell.

Syntax

TXTextControl.TableCellAttribute(TableId, Row, Column, Attribute) [= value]
Parameter | Description
TableId | Specifies a table. It is the same identifier set with the TableInsert method.
Row | Specifies a row number which identifies a certain cell in the table. The first row has the number one. This parameter set to zero means a complete column.
Column | Specifies a column number which identifies a certain cell in the table. The first column has the number one. This parameter set to zero means a complete row.
Attribute | Specifies the type of attribute. It can be anyone of the values listed in Constants.

Constants

Valid values for the Attribute parameter are:

Constant Description
txTableCellHorizontalPos (0)

The property value is the horizontal position of a table cell.
txTableCellHorizontalExt (1)

The property value is the horizontal extension of a table cell.
txTableCellBorderWidth (2)

The property value is the border width of a table cell.
txTableCellTextGap (3)

The property value is the width of the gap between a cell's border and its text.
txTableCellBackColor (4)

The property value is the table cell's background color.
txTableCellLeftBorderWidth (5)

The property value is the left border width of a table cell.
txTableCellTopBorderWidth (6)

The property value is the top border width of a table cell.
txTableCellRightBorderWidth (7)

The property value is the right border width of a table cell.
txTableCellBottomBorderWidth (8)

The property value is the bottom border width of a table cell.
txTableCellLeftTextGap (9)

The property value is the width of the gap between a cell's left border and its text.
txTableCellTopTextGap (10)

The property value is the width of the gap between a cell's top border and its text.
txTableCellRightTextGap (11)

The property value is the width of the gap between a cell's right border and its text.
txTableCellBottomTextGap (12)

The property value is the width of the gap between a cell's bottom border and its text.
txTableCellVertAlign (13)

The property value defines the vertically alignment of the cell's text. The following values are possible:

Constant | Description
0 | The text is a aligned at the top of the cell.
1 | The text is vertically centered.
2 | The text is a aligned at the bottom of the cell.
txTableCellHeight (14)

The property value is the minimum height of a table cell. If zero is set or returned, the cell's height is always determined through the containing text.
txTableCellPageBreakAllowed (15)

The property value is True, if the table cell can be formatted across page breaks. The property value is False, if the table cell must not be formatted across page breaks.
txTableCellIsHeader (16)

The property value is True, if the table cell belongs to a table header. The property value is False, if the table cell does not belong to a table header.
txTableCellLeftBorderColor (17)

The property value is the color of the table cell's left border line.
txTableCellTopBorderColor (18)

The property value is the color of the table cell's top border line.
txTableCellRightBorderColor (19)

The property value is the color of the table cell's right border line.
txTableCellBottomBorderColor (20)

The property value is the color of the table cell's bottom border line.

Remarks

When the row and column parameters are both set to zero the attributes of a complete table can be manipulated. When more than one table cell is specified this property returns Null (Visual Basic) or is set to empty (C++) if the cells are differently formatted.

Data Types

TableId: | Integer
Row: | Integer
Column: | Integer
Attribute: | Integer
Property value: | Variant

Limitations

Run time only.

Example

This Basic example sets a red background color for the leftmost column of a table:

TXTextControl1.TableCellAttribute(id, 0, 1, 4) = RGB(255, 0, 0)

See Also

  • Tables
  • TableInsert Method
  • TableCellText Property
  • Programming Category: Tables


TXTextControl.TXTextControl.TableCellData Property

Returns or sets a string associated with the specified table cell. Setting a string for a certain cell overwrites a prior string. Setting an empty string deletes the prior string. The data associated with table cells is stored in the TX Text Control file format and can be copied via the clipboard.

Introduced: 17.0.

Syntax

TXTextControl.TableCellData((TableId, Row, Column) [= string]
Parameter | Description
TableId | Specifies a table. It is the same identifier set with the TableInsert method.
Row, Column | Specify a row and column number which identifies a certain cell in the table. The first has the number 1, 1.

Data Types

TableId: | Integer
Row: | Integer
Column: | Integer
Property value: | String

Limitations

Run time only.

See Also

  • Tables
  • TableInsert Method
  • TableRows Property
  • TableColumns Property
  • Programming Category: Tables


TXTextControl.TXTextControl.TableCellLength Property

Returns the number of characters in a table cell.

Syntax

TXTextControl.TableCellLength(TableId, Row, Column)
Parameter | Description
TableId | Specifies a table. It is the same identifier set with the TableInsert method.
Row, Column | Specify a row and column number which identifies a certain cell in the table. The first has the number 1, 1.

Data Types

TableId: | Integer
Row: | Integer
Column: | Integer
Property value: | Long

Limitations

Read only, run time only.

See Also

  • Tables
  • Programming Category: Tables


TXTextControl.TXTextControl.TableCellSelect Method

This method can be used to select a table cell, a table row, a table column or a complete table.

Introduced: 19.0.

Syntax

TXTextControl.TableCellSelect TableId, Row, Column
Parameter | Description
TableId | Specifies the table's identifier. This must be the value returned from the TableInsert or the TableInsertDialog method.
Row | Specifies a row number, which identifies a certain cell in the table. The first row has the number one. This parameter set to zero means a complete column.
Column | Specifies a column number, which identifies a certain cell in the table. The first column has the number one. This parameter set to zero means a complete row. If both parameters, Row and Column, are set to zero, then the complete table is selected.

Return Value

The return value is True, if the specified table cell could be selected. Otherwise, it is False. False is returned, if the specified table id is invalid or the specified row or column number does not exist.

Data Types

TableId: | Integer
Row: | Long
Column: | Long
Return value: | Boolean

See Also

  • Tables
  • Programming Category: Tables


TXTextControl.TXTextControl.TableCellStart Property

Returns the character index (one-based) of the first character in a table cell.

Syntax

TXTextControl.TableCellStart(TableId, Row, Column)
Parameter | Description
TableId | Specifies a table. It is the same identifier set with the TableInsert method.
Row, Column | Specify a row and column number which identifies a certain cell in the table. The first has the number 1, 1.

Data Types

TableId: | Integer
Row: | Integer
Column: | Integer
Property value: | Long

Limitations

Read only, run time only.

See Also

  • Tables
  • Programming Category: Tables


TXTextControl.TXTextControl.TableCellText Property

Returns or sets the text of a table cell.

Syntax

TXTextControl.TableCellText((TableId, Row, Column) [= string]
Parameter | Description
TableId | Specifies a table. It is the same identifier set with the TableInsert method.
Row, Column | Specify a row and column number which identifies a certain cell in the table. The first has the number 1, 1.

Data Types

TableId: | Integer
Row: | Integer
Column: | Integer
Property value: | String

Limitations

Run time only.

See Also

  • Tables
  • TableInsert Method
  • TableRows Property
  • TableColumns Property
  • Programming Category: Tables


TXTextControl.TXTextControl.TableCreated Event

Occurs after a new table has been created as a result of a text insertion via the clipboard. It does not occur when the table is inserted with the TableInsert method or when a previously saved document is reloaded.

Syntax

TableCreated(TableId, NewTableId)
Parameter | Description
TableId | Is the number of the created table. This number can be changed through setting the NewTableId parameter.
NewTableId | Is a new table identifier for the created table. It must be in the range of 10 to 32,767.

Data Types

TableId: | Integer
NewTableId: | Integer

See Also

  • Tables
  • TableDeleted Event
  • TableInsert Method
  • Programming Category: Tables


TXTextControl.TXTextControl.TableDelete Method

This method can be used to delete a complete table from the document.

Introduced: 19.0.

Syntax

TXTextControl.TableCellSelect TableId
Parameter | Description
TableId | Specifies the table's identifier. This must be the value returned from the TableInsert method. If this parameter is set to zero, the currently selected table or the table at the text input position is deleted.

Return Value

The return value is True, if the specified table could be deleted. Otherwise, it is False. False is returned, if the specified table id is invalid or there is no table at the text input position.

Data Types

TableId: | Integer
Return value: | Boolean

See Also

  • Tables
  • Programming Category: Tables


TXTextControl.TXTextControl.TableDeleted Event

Occurs after a table has been deleted.

Syntax

TableDeleted(TableId)
Parameter | Description
TableId | Is the the identifier of the deleted table.

Data Types

Integer.

See Also

  • Tables
  • TableCreated Event
  • Programming Category: Tables


TXTextControl.TXTextControl.TableDeleteColumn Method

This method deletes the currently selected table columns or the table column containing the text input position. The TableCanDeleteColumn property informs whether columns can be deleted.

Syntax

TXTextControl.TableDeleteColumn

Return Value

The method returns True if the table column could successfully be deleted. The method returns False if an error has occurred or if the current input position is not within a table.

Data Types

Return value: Boolean.

See Also

  • Tables
  • TableInsertColumn Method
  • TableCanDeleteColumn Property
  • Programming Category: Tables


TXTextControl.TXTextControl.TableDeleteLines Method

This method deletes the currently selected table lines or the table line at the current input position.

Syntax

TXTextControl.TableDeleteLines

Return Value

The method returns True if table lines have been deleted. Otherwise it returns False.

Data Types

Return value: Boolean

See Also

  • Tables
  • TableInsertLines Method
  • TableCanDeleteLines Property
  • Programming Category: Tables


TXTextControl.TXTextControl.TableColAtInputPos Property

Returns the number of the current input column in a table. It is zero when the input position is not inside a table or when more than one table cell is selected.

Syntax

TXTextControl.TableColAtInputPos

Data Types

Integer.

Limitations

Read only, run time only.

See Also

  • Tables
  • TableAtInputPos Property
  • TableRowAtInputPos Property
  • Programming Category: Tables


TXTextControl.TXTextControl.TableColumns Property

Informs about the number of columns a specified table contains.

Syntax

TXTextControl.TableColumns(TableId)
Parameter | Description
TableId | Specifies a table. It is the same identifier set with the TableInsert method.

Data Types

TableId: | Integer
Property value: | Integer

Limitations

Read only, run time only.

See Also

  • Tables
  • TableInsert Method
  • TableRows Property
  • Programming Category: Tables


TXTextControl.TXTextControl.TableFormatChanged Event

Occurs after a table has been formatted with the built-in mouse-interface.

Syntax

TableFormatChanged(&nbsp)

See Also

  • Tables
  • Programming Category: Tables


TXTextControl.TXTextControl.TableFromSelection Method

This method returns the table identifier of the currently selected table. It is zero, if no table or more than one table is selected.

Introduced: 19.0.

Syntax

TXTextControl.TableFromSelection Row, Column
Parameter | Description
Row | TextControl copies the number of the selected row to this variable. The first row has the number one. If more than one row is selected, the row number is 0.
Column | TextControl copies the number of the selected column to this variable. The first column has the number one. If more than one column is selected, the column number is 0.

Return Value

The return value is the table's identifier. This must be the value returned from the TableInsert method. The return value is 0, if no table or more than one table is selected.

Data Types

Row: | Long
Column: | Long
Return value: | Integer

See Also

  • Tables
  • Programming Category: Tables


TXTextControl.TXTextControl.TableGetOuter Method

This method returns a table's outer table.

Introduced: 11.0.

Syntax

TXTextControl.TableGetOuter TableId
Parameter | Description
TableId | Specifies a table identifier. It is the same identifier set with the TableInsert method.

Return Value

Specifies the table identifier of the given table's outer table or zero, if the given table is a top-level table. It is also zero, if the specified table is invalid.

Data Types

TableId: | Integer
Return value: | Integer

See Also

  • Tables
  • Programming Category: Tables


TXTextControl.TXTextControl.TableGetOuterMost Method

This method returns a table's outermost table.

Introduced: 11.0.

Syntax

TXTextControl.TableGetOuterMost TableId
Parameter | Description
TableId | Specifies a table identifier. It is the same identifier set with the TableInsert method.

Return Value

Specifies the table identifier of the given table's outermost table or zero, if the given table is already a top-level table. It is also zero, if the specified table identifier is invalid.

Data Types

TableId: | Integer
Return value: | Integer

See Also

  • Tables
  • Programming Category: Tables


TXTextControl.TXTextControl.TableGridLines Property

This property determines whether or not grid lines in tables are visible.

Syntax

TXTextControl.TableGridLines [= boolean]
Setting | Description
True | (Default) Grid lines in tables are visible.
False | Grid lines in tables are invisible.

Data Types

Boolean.

See Also

  • Tables
  • Programming Category: Tables


TXTextControl.TXTextControl.TableInsert Method

This method inserts a new table in the text.

Syntax

TXTextControl.TableInsert Rows, Columns, TextPos [, TableId]
Parameter | Description
Rows | Specifies the number of rows.
Columns | Specifies the number of columns.
TextPos | Specifies the text position where the new table is to be inserted. It is inserted at the current input position when this parameter is set to -1.
TableId | Optional. Specifies a table identifier. This identifier can be used to access or to alter the table's text and attributes. It must be in the range of 10 to 32,767.

Return Value

Parameter | Description
0 | An error has occurred or the table could not be inserted. Tables cannot be inserted when text has been selected.
-1 | The new table has been inserted at the top or at the bottom of an existing table. In this case the new table is combined with the existing table.
otherwise | The table's identifier. This is the same value as specified with the TableId parameter or an internal identifier selected by Text Control when the optional TableId parameter has been omitted.

Data Types

Rows: | Integer
Columns: | Integer
TextPos: | Long
TableId: | Integer
Return value: | Integer

See Also

  • Tables
  • TableCanInsert Property
  • TableDeleteLines Method
  • Programming Category: Tables


TXTextControl.TXTextControl.TableInsertColumn Method

This method inserts a table column left or right of the column with the current input position. A table column can only be inserted if the current input position is in a table and if no text is selected. The TableCanInsertColumn property informs whether a column can be inserted.

Syntax

TXTextControl.TableInsertColumn Position
Parameter Description
Position

Specifies where to insert the table column. Possible values are the following:

Constant | Description
txTableInsertInFront (1) | The column is inserted left of the column with the current input position.
txTableInsertAfter (2) | The column is inserted right of the column with the current input position.

Return Value

The method returns True if the table column could successfully be inserted. The method returns False if an error has occurred or if the current input position is not within a table.

Data Types

Return value: Boolean

See Also

  • Tables
  • TableDeleteColumn Method
  • TableCanInsertColumn Property
  • Programming Category: Tables


TXTextControl.TXTextControl.TableInsertDialog Method

This method opens a built-in dialog box which offers options to define a new table. When the dialog box is left with OK, the new table is inserted in the text.

Introduced: 19.0.

Syntax

TXTextControl.TableInsertDialog [TableId]
Parameter | Description
TableId | Optional. Specifies a table identifier. This identifier can be used to access or to alter the table's text and attributes. It must be in the range of 10 to 32,767.

Return Value

Parameter | Description
0 | An error has occurred or the table could not be inserted. Tables cannot be inserted when text has been selected.
-1 | The new table has been inserted at the top or at the bottom of an existing table. In this case the new table is combined with the existing table.
otherwise | The table's identifier. This is the same value as specified with the TableId parameter or an internal identifier selected by Text Control when the optional TableId parameter has been omitted.

Data Types

TableId: | Integer
Return value: | Integer

See Also

  • Tables
  • TableCanInsert Property
  • Programming Category: Tables
  • Programming Category: Built-in Dialog Boxes


TXTextControl.TXTextControl.PageNumberDialog Method

This method opens a built-in dialog box to set formatting attributes for the specified pagenumber field.

Introduced: 19.0.

Syntax

TXTextControl.PageNumberDialog FieldId
Parameter | Description
FieldId | Specifies the identifier of the marked text field for which attributes are changed. It must be a field of the type txFieldPageNumber or txFieldAllPages. The field type can be set with the FieldType property.

Return Value

The method returns True when the user has changed one or more attibutes and the dialog box has been left with Ok. The method returns False when the dialog has been left with Cancel.

Data Types

FieldId: | Integer
Return value: | Boolean

See Also

  • Headers and Footers
  • Programming Category: Headers and Footers
  • Programming Category: Built-in Dialog Boxes


TXTextControl.TXTextControl.Paste Method

Replaces the current selection in the Text Control with the contents of the Clipboard. Only data provided in the specified format is inserted. This method can be used to change the default behaviour, if the clipboard contains the data in more than one format. By default, TXTextControl inserts data from the clipboard in the following order: textframe, formatted image, formatted text (TXTextControl format), formatted text (RTF format), formatted text (HTML format), plain text, image, OLE object.

Introduced: 21.0.

Syntax

TXTextControl.Paste Format
Parameter Description
Format

Specifies the format to insert. It must be one of the values contained in the array returned through the ClipboardFormats property. It can be one of the following Values:

Value | Description
TXTextControlFormat (2) | Specifies formatted text in the internal TX Text Control format.
RichTextFormat (3) | Specifies RTF format (Rich Text Format).
Image (4) | Specifies an image. An image can be pasted, if it is a device dependent or a device independent bitmap, a TIFF image or a Windows metafile.
PlainText (5) | Specifies unformatted text.
OLEObject (6) | Specifies an OLE object.
TXTextControlTextframe (7) | Specifies a TX Text Control textframe including its contents. The clipbord contains also information about how the textframe is positioned in the document (inline or geometrically positioned).
TXTextControlImage (8) | Specifies an image including information about how the image is positioned in the document (inline or geometrically positioned).
HTMLFormat (9) | Specifies HTML format (Hypertext Markup Language).

Return Value

The return value is true, if something has been pasted. Otherwise, it is false.

Data Types

Format: | Integer
Return value: | Boolean

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.TableInsertLines Method

This member function inserts table lines above or below the table line with the current input position. Table lines can only be inserted if the current input position is in a table and if no text is selected. The TableCanInsertLines property informs whether table lines can be inserted.

Syntax

TXTextControl.TableInsertLines Position, Lines
Parameter Description
Position

Specifies where to insert the table lines. Possible values are the following:

Constant | Description
txTableInsertInFront (1) | Table lines are inserted above the line with the current input position.
txTableInsertAfter (2) | Table lines are inserted below the line with the current input position.
Lines

Specifies the number of lines to insert.

Return Value

The method returns True if the table lines could successfully be inserted. The method returns False if an error has occurred or if the current input position is not within a table.

Data Types

Return value: Boolean

See Also

  • Tables
  • TableDeleteLines Method
  • TableCanInsertLines Property
  • Programming Category: Tables


TXTextControl.TXTextControl.TableMergeCells Method

This method merges all selected table cells. The TableCanMergeCells property informs whether table cells can be merged or not.

Introduced: 17.0.

Syntax

TXTextControl.TableMergeCells

Return Value

The method returns True, if the table cells could successfully be merged. The method returns False, if an error has occurred, or if the current selection is not within a single table.

Data Types

Return value: Boolean.

See Also

  • Tables
  • TableSplitCells Method
  • TableCanMergeCells Property
  • Programming Category: Tables


TXTextControl.TXTextControl.TableNestedLevel Property

Gets the nested level for the specified table. Top level tables have a level of 1.

Introduced: 11.0.

Syntax

TXTextControl.TableNestedLevel(TableId)
Parameter | Description
TableId | Specifies a table. It is the same identifier set with the TableInsert method.

Data Types

TableId: | Integer
Property value: | Integer

Limitations

Run time only.

See Also

  • Tables
  • Programming Category: Tables


TXTextControl.TXTextControl.TableNext Method

This method returns a enumaration number of the table that follows the specified table in the Text Control's current text. It can be used to enumerate all tables. In a list of linked Text Controls the search is performed in all controls. The method uses enumeration numbers instead of table identifiers because table identifiers are not unique. The corresponding table identifer is retrieved by the TableId parameter.

Syntax

TXTextControl.TableNext EnumerationNumber, TableId
Parameter | Description
EnumerationNumber | Specifies a enumeration number. The method returns the enumeration number of the table that follows the table with this number. If this parameter is zero, the first table's enumeration number is returned.
TableId | Text Control copies the table's identifier to this variable. This is the same value as returned from the TableInsert method.

Return Value

Specifies the enumeration number of the next table. It can be used for the next TableNext call. The return value is zero when the last table has been reached or when the specified enumeration number was invalid.

Data Types

EnumerationNumber: | Integer
TableId: | Integer
Return value: | Integer

See Also

  • Tables
  • Programming Category: Tables


TXTextControl.TXTextControl.TableRowAtInputPos Property

Returns the number of the current input row in a table. It is zero when the input position is not inside a table or when more than one table cell is selected.

Syntax

TXTextControl.TableRowAtInputPos

Data Types

Integer.

Limitations

Read only, run time only.

See Also

  • Tables
  • TableAtInputPos Property
  • TableColAtInputPos Property
  • Programming Category: Tables


TXTextControl.TXTextControl.TableRows Property

Informs about the number of rows a specified table contains.

Syntax

TXTextControl.TableRows(TableId)
Parameter | Description
TableId | Specifies a table. It is the same identifier set with the TableInsert method.

Data Types

TableId: | Integer
Property value: | Integer

Limitations

Read only, run time only.

See Also

  • Tables
  • TableInsert Method
  • TableColumns Property
  • Programming Category: Tables


TXTextControl.TXTextControl.TableSelectCells Method

This method can be used to select a rectangular part of a table defined through two table cells. To select a single cell, row, column or a whole table, use the TableCellSelect method.

Introduced: 21.0.

Syntax

TXTextControl.TableSelectCells TableId, StartRow, StartColumn, EndRow, EndColumn
Parameter | Description
TableId | Specifies the table's identifier. This must be the value returned from the TableInsert or the TableInsertDialog method.
StartRow | Specifies the row number of the top-left table cell. The first row has the number one.
StartColumn | Specifies the column number of the top-left table cell. The first column has the number one.
EndRow | Specifies the row number of the bottom-right table cell.
EndColumn | Specifies the column number of the bottom-right table cell.

Return Value

The return value is True, if the specified table cells could be selected. Otherwise, it is False. False is returned, if the specified table id is invalid or the specified row and/or column numbers do not exist.

Data Types

TableId: | Integer
StartRow: | Long
StartColumn: | Long
EndRow: | Long
EndColumn: | Long
Return value: | Boolean

See Also

  • Tables
  • Programming Category: Tables


TXTextControl.TXTextControl.TableSplit Method

Splits a table below or above the current input position. If the table does not contain the current input position, it cannot be split. The TableCanSplit property can be used to determine whether a table can be split or not. If a table is split above the first row, a new line is inserted above the table and if a table is split below the last row, a new line is inserted below the table. This is useful to insert text above or below a nested table that immediately starts and/or ends at the beginning or the end of the cell in which it is nested.

Introduced: 11.0.

Syntax

TXTextControl.TableSplit Position
Parameter Description
Position

Specifies where to split the table. Possible values are the following:

Constant | Description
txTableInsertInFront (1) | The table is split below the current input position.
txTableInsertAfter (2) | The table is split in front of the current input position.

Return Value

The method returns True, if the table can successfully be split. The method returns False, if an error has occurred or if the current input position is not within a table.

Data Types

Position | Integer
Return value: | Boolean

See Also

  • Tables
  • TableCanSplit Property
  • Programming Category: Tables


TXTextControl.TXTextControl.TableSplitCells Method

This method splits all selected table cells. Only previously merged cells can be split. The TableCanSplitCells property can be used to determine if table cells can be split or not.

Introduced: 17.0.

Syntax

TXTextControl.TableSplitCells

Return Value

The method returns True, if the table cells could successfully be split. The method returns False, if an error has occurred, or if the current selection is not within a single table.

Data Types

Return value: Boolean.

See Also

  • Tables
  • TableMergeCells Method
  • TableCanSplitCells Property
  • Programming Category: Tables


TXTextControl.TXTextControl.TabPos Property

Determines the position, in twips, of a certain tab. The tab number must have previously been determined with the TabCurrent property.

Syntax

TXTextControl.TabPos [= value]

Data Types

Long.

See Also

  • TabCurrent Property
  • TabType Property
  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.TabType Property

Determines the type of a certain tab. The tab number must have previously been determined with the TabCurrent property.

Syntax

TXTextControl.TabType [= value]
Setting | Description
1 | Left tab.
2 | Right tab.
3 | Centered tab.
4 | Decimal tab.
5 | Right tab at the right most text position. For this type any position set with the TabPos property is ignored.

Data Types

Integer.

See Also

  • TabCurrent Property
  • TabPos Property
  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.Text Property

Returns or sets the complete text of a Text Control. This property is a Text Control's default property.

Syntax

TXTextControl.Text [= string]

Data Types

String.

See Also

  • PDF Export
  • Programming Category: Loading, Saving and Database Support


TXTextControl.TXTextControl.TextBkColor Property

Returns or sets the background color for selected text. Text Control uses the Microsoft Windows operating enviroment red-green-blue (RGB) color scheme.

Syntax

TXTextControl.TextBkColor [= value]

Remarks

The TextBkColor property applies only to the currently selected text. The BackColor property can be used to set the window background color. The valid range for a RGB color is 0 to &HFFFFFF. The high byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively. The red, green, and blue components are each represented by a number between 0 and 255 (&HFF).

Data Types

Long.

See Also

  • FormatSelection Property
  • BackColor Property
  • Programming Category: Character Formatting


TXTextControl.TXTextControl.TextDirection Property

Specifies the writing direction. A paragraph's writing direction can be either left to right or right to left.

Introduced: 20.0.

Syntax

TXTextControl.TextDirection [= value]
Setting | Description
txRightToLeft | The text is formatted from right to left.
(Default) txLeftToRight | The text is formatted from left to right.
0 | Get only. The property returns 0, if more than one paragraph is selected and these paragraphs have different writing directions.

Remarks

If the FormatSelection property has previously been set to True, changing this property affects only the currently selected paragaphs. If FormatSelection has been set to False, the setting applies to the entire control.

Data Types

Integer.

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.TextFrameActivated Event

Occurs when a text frame has obtained the input focus.

Introduced: 12.0.

Syntax

TextFrameActivated(TextFrameId)
Parameter | Description
TextFrameId | Is the identifier of the activated text frame.

Remarks

The value of the ObjectCurrent property is updated with the identifier given through the TextFrameId parameter.

Data Types

TextFrameId: Integer

See Also

  • TextFrameDeactivated Event
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.TextFrameBackColor Property

Returns or sets the background color of a text frame. TX Text Control uses the Microsoft Windows operating enviroment red-green-blue (RGB) color scheme. The ObjectCurrent property determines the text frame.

Introduced: 12.0.

Syntax

TXTextControl.TextFrameBackColor [= value]
Setting | Description
RGB colors | The valid range for a RGB color is 0 to &HFFFFFF. The high byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively. The red, green, and blue components are each represented by a number between 0 and 255 (&HFF).
System colors | Colors specified by the system color constants. If the high byte is not 0, TX Text Control uses the system colors, as defined in the user's Control Panel settings.

Data Types

Long.

Limitations

Run time only.

See Also

  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.TextFrameBorderWidth Property

Specifies the width, in twips, of a text frame's border line. To alter the distance between the border line and the text, use the TextFrameInternalMargin property. The ObjectCurrent property determines the text frame. If this property is set to zero, the text frame has no border line.

Introduced: 12.0.

Syntax

TXTextControl.TextFrameBorderWidth [= value]

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.TextFrameDeactivated Event

Occurs when a text frame has lost the input focus.

Introduced: 12.0.

Syntax

TextFrameDeactivated(TextFrameId)
Parameter | Description
TextFrameId | Is the identifier of the deactivated text frame.

Remarks

The value of the ObjectCurrent property is updated with the identifier given through the TextFrameId parameter.

Data Types

TextFrameId: Integer

See Also

  • TextFrameActivated Event
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.TextFrameInsert Method

This method inserts a new text frame anchored to a paragraph. The text flows around the text frame.

Introduced: 12.0.

Syntax

TXTextControl.TextFrameInsert TextPos, Alignment, PosX, PosY, Width, Height, TextFlow, DistanceL, DistanceT, DistanceR, DistanceB
Parameter Description
TextPos

Specifies a text position in the paragraph where to insert the text frame. If TextPos is -1, the text frame is anchored to the paragraph at the current input position.
Alignment

Specifies the text frame's horizontal alignment. It can be one of the following values:

Value | Description
0 | The horizontal position is given through the PosX parameter.
1 | The text frame is left aligned relative to the paragraph to which it is anchored.
2 | The text frame is right aligned relative to the paragraph to which it is anchored.
3 | The text frame is centered relative to the paragraph to which it is anchored.
PosX

Specifies the text frame's horizontal position in twips relative to the left border of the paragraph. This value is used if the Alignment parameter has been set to 0.
PosY

Specifies the text frame's vertical position in twips relative to the top border of the paragraph.
Width

Specifies the width of the text frame in twips. If this parameter is set to zero, a built-in mouse interface is started which enables the end-user to define the size of the text frame through a rectangle, drawn with the mouse.
Height

Specifies the height of the text frame in twips. If this parameter is set to zero, a built-in mouse interface is started which enables the end-user to define the size of the text frame through a rectangle, drawn with the mouse.
TextFlow

Specifies how text flows around the text frame. It can be one of the following values:

Value | Description
2 | The text stops at the top and continues at the bottom of the text frame.
3 | The text flows around the text frame. Empty areas at the left and right side are filled.
DistanceL, DistanceT, DistanceR, DistanceB

Specifies distances, in twips, between the text frame and the document's text.

Return Value

The method returns the text frame's identifier, if a new text frame could be inserted. Otherwise, it returns zero. The text frame's identifier can also be obtained with the ObjectCurrent property.

Data Types

TextPos: | Long
Alignment: | Integer
PosX: | Long
PosY: | Long
Width: | Integer
Height: | Integer
TextFlow: | Integer
DistanceL: | Integer
DistanceT: | Integer
DistanceR: | Integer
DistanceB: | Integer
Return value: | Integer

See Also

  • TextFrameInsertAsChar Method
  • TextFrameInsertFixed Method
  • Text frame and object attribute properties
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.TextFrameInsertAsChar Method

This method inserts a new text frame, which is then handled as a single character in the text.

Introduced: 12.0.

Syntax

TXTextControl.TextFrameInsertAsChar TextPos, Width, Height
Parameter | Description
TextPos | Specifies a text position where the text frame should be inserted. If TextPos is -1, the text frame is inserted at the current input position.
Width | Specifies the width of the text frame in twips. If this parameter is set to zero, a built-in mouse interface is started which enables the end-user to define the size of the text frame through a rectangle, drawn with the mouse.
Height | Specifies the height of the text frame in twips. If this parameter is set to zero, a built-in mouse interface is started which enables the end-user to define the size of the text frame through a rectangle, drawn with the mouse.

Return Value

The method returns the text frame's identifier, if a new text frame could be inserted. Otherwise, it returns zero. The text frame's identifier can also be obtained with the ObjectCurrent property.

Data Types

TextPos: | Long
Width: | Integer
Height: | Integer
Return value: | Integer

See Also

  • TextFrameInsert Method
  • TextFrameInsertFixed Method
  • Text frame and object attribute properties
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.TextFrameInsertFixed Method

This method inserts a new text frame at a fixed geometrical position. The text flows around the text frame.

Introduced: 12.0.

Syntax

TXTextControl.TextFrameInsertFixed PageNo, PosX, PosY, Width, Height, TextFlow, DistanceL, DistanceT, DistanceR, DistanceB
Parameter Description
PageNo

Specifies the number of the page where the text frame is inserted, beginning with number 1. If the ViewMode property has not been set to Page View, this parameter must be set to zero. In this case, the PosY parameter specifies the position relative to the top of the control.
PosX

Specifies the text frame's horizontal position in twips relative to the left border of the page.
PosY

Specifies the text frame's vertical position in twips relative to the top border of the page or control.
Width

Specifies the width of the text frame in twips. If this parameter is set to zero, a built-in mouse interface is started which enables the end-user to define the size of the text frame through a rectangle, drawn with the mouse.
Height

Specifies the height of the text frame in twips. If this parameter is set to zero, a built-in mouse interface is started which enables the end-user to define the size of the text frame through a rectangle, drawn with the mouse.
TextFlow

Specifies how text flows around the text frame. It can be one of the following values:

Value | Description
2 | The text stops at the top and continues at the bottom of the text frame.
3 | The text flows around the text frame. Empty areas at the left and right side are filled.
DistanceL, DistanceT, DistanceR, DistanceB

Specifies distances, in twips, between the text frame and the document's text.

Return Value

The method returns the text frame's identifier, if a new text frame could be inserted. Otherwise, it returns zero. The text frame's identifier can also be obtained with the ObjectCurrent property.

Data Types

PageNo: | Long
PosX: | Long
PosY: | Long
Width: | Integer
Height: | Integer
TextFlow: | Integer
DistanceL: | Integer
DistanceT: | Integer
DistanceR: | Integer
DistanceB: | Integer
Return value: | Integer

See Also

  • TextFrameInsertAsChar Method
  • TextFrameInsert Method
  • Text frame and object attribute properties
  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.TextFrameInternalMargin Property

Specifies the distance (in twips) between a text frame's border line and the text. The ObjectCurrent property determines the text frame.

Introduced: 12.0.

Syntax

TXTextControl.TextFrameInternalMargin(index) [= value]
Parameter | Description
index | Specifies one of the four possible margins: left (1), top (2), right (3), bottom (4).

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.TextFrameMarkerLines Property

This property determines whether or not marker lines for text frames are visible. Marker lines show a text frame's border if the text frame has no border line. A text frame's border line can be set with the TextFrameBorderWidth property.

Introduced: 12.0.

Syntax

TXTextControl.TextFrameMarkerLines [= boolean]
Setting | Description
True | (Default)Marker lines are visible.
False | Marker lines are invisible.

Data Types

Boolean.

See Also

  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.TextFrameSelect Method

This method determines whether a certain Text Control property or method manipulates a text frame or the main text. This method selects a text frame for programming. It does not set the input focus to a text frame and does not show the selection frame with the resize handles.

Introduced: 12.0.

Syntax

TXTextControl.TextFrameSelect TextFrameId
Parameter Description
TextFrameId

Is the identifier of the text frame to select. It must be an identifier returned through the TextFrameInsert, TextFrameInsertAsChar or TextFrameInsertFixed method.

If this parameter is zero, which is the default mode, a Text Control performs automatic selection, which means that a certain property or method manipulates the text part with the current input position.

If this parameter is -1, the method selects the main text, which means that a property or method manipulates the main text, independent of which text part has the current input focus.

Return Value

The method returns True, if the selection could be performed, otherwise it returns False.

Remarks

The TX Text Control button bar, ruler and status bar need the default automatic mode for correct working. Therefore, when a selection is no longer needed, it should be reset to the default mode.

Data Types

TextFrameId: | Integer
Return value: | Boolean

See Also

  • Programming Category: Images, Text Frames and OLE Objects


TXTextControl.TXTextControl.Undo Method

This method can be used to undo the last Text Control operation.

Syntax

TXTextControl.Undo

Return Value

The method returns True if the undo operation was successful. Otherwise it returns False.

Data Types

Return value: Boolean

See Also

  • Redo Method
  • CanUndo Property
  • CanRedo Property
  • Programming Category: Undo


TXTextControl.TXTextControl.VerticalRulerHandle Property

Specifies the ruler control to be used as vertical ruler with a Text Control.

Introduced: 13.0.

Syntax

TXTextControl.VerticalRulerHandle [= Ruler.hWnd]

Data Types

Handle.

Limitations

Run time only.

See Also

  • StatusBarHandle Property
  • ButtonBarHandle Property
  • RulerHandle Property
  • Programming Category: Tool Bars


TXTextControl.TXTextControl.VExpand Event

Occurs when the Text Control has changed its window size vertically. This event can only occur when the AutoExpand property is set to True.

Syntax

VExpand( )

See Also

  • AutoExpand Property
  • HExpand Event
  • Programming Category: Control Settings


TXTextControl.TXTextControl.ViewMode Property

Returns or sets the mode in which Text Control displays its text contents. See Technical Articles - Text Formatting and Views for more information.

Syntax

TXTextControl.ViewMode [= value]
Setting | Description
0 - Normal View | Do not display page borders, margins and gaps.
2 - Page View | Displays a three-dimensional view of the document's pages.
3 - Floating Text | (Default) The text is formatted depending on the control's window width. Invisible text can be displayed using a vertical scrollbar.
4 - Simple Control | The text is formatted depending on the control's window width and height. There is no scroll interface to scroll to invisible text.

Data Types

Integer.

See Also

  • PageWidth Property
  • PageHeight Property
  • Programming Category: Control Settings


TXTextControl.TXTextControl.VScroll Event

Occurs when the vertical scroll position has been changed.

Syntax

VScroll( )

See Also

  • HScroll Event
  • Programming Category: Scrolling


TXTextControl.TXTextControl.WidowOrphanLines Property

Gets or sets the number of lines for widow/orphan control. Widow/orphan control avoids that a paragraph is started at the bottom of a page and that either, the majority of its lines, or only a few lines are displayed on the next page. This property's value determines how many lines must not be separated from the rest of the paragraph. For example, if this property is set to two, there must be at least three lines of the paragraph at the bottom of the previous page and at least three lines at the top of the next page. Otherwise, the complete paragraph is displayed on the next page. If this property is set to zero, widow/orphan control is disabled. The property sets the value for all paragraphs currently selected.

Introduced: 13.0.

Syntax

TXTextControl.WidowOrphanLines [= value]

Remarks

The property returns 0 when the text selection contains multiple paragraphs with mixed setting.

Data Types

Integer.

Limitations

The property's value must be between 0 and 3.

Run time only.

See Also

  • Programming Category: Paragraph Formatting


TXTextControl.TXTextControl.WordWrapMode Property

This property returns or sets the mode how Text Control handles word wrapping in lines without space or other word breaking characters. If a single word is too large to fit in a line Text Control either displays the not fitting characters in the following line or hides these characters and displays an overflow mark (a vertical line).

Syntax

TXTextControl.WordWrapMode [= Mode]
Setting | Description
0 - Line overflow | Hides characters that do not fit on a line and displays an overflow mark.
1 - Word wrapping | (Default) Displays the remaining characters of a word that do not fit on a line, on the next line.

Data Types

Integer.

See Also

  • Programming Category: Control Settings


TXTextControl.TXTextControl.XMLEditMode Property

Specifies whether Text Control operates in an edit mode that validates the XML document according to the document's DTD.

Syntax

TXTextControl.XMLEditMode [= value]
Setting | Description
1 - Validation | Every operation that manipulates an XML document is validated according to the document's DTD. This mode is read only and is automatically switched on after loading a valid XML document.
2 - No Validation | Text Control operates in its normal editor mode. No validation of an XML document occurs. Because the document can be invalid after every operation the document cannot be saved in XML format.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Working with XML Files
  • Programming Category: XML Programming


TXTextControl.TXTextControl.XMLElements Property

Returns a collection of all XML elements with the same tag name.

Syntax

TXTextControl.XMLElements ElementName
Parameter | Description
ElementName | Specifies the name of the XML elements. The returned collection object contains all XML elements with this name.

Data Types

XMLElements Collection object.

Limitations

Read only, run time only.

See Also

  • Working with XML Files
  • XMLElements Collection
  • XMElement Object
  • Programming Category: XML Programming


TXTextControl.TXTextControl.XMLInvalid Event

Occurs when a loaded XML document cannot be validated with the document type definition (DTD) referenced in the document. The document's contents are loaded but the document itself cannot be handled or saved as XML document.

Syntax

XMLInvalid(FilePos, Scode, Description, CancelDisplay)
Parameter | Description
FilePos | Is the absolute file position where the error occurred.
Scode | Is the OLE Status Code.
Description | Explains the reason for the error. This string can be changed.
CancelDisplay | Can be set to True if the application wants to display its own error string. When this parameter is not set to True, the control will display a message box showing an error string.

Data Types

FilePos: | Long
Scode: | Long
Description: | String
CancelDisplay: | Boolean

See Also

  • Working with XML Files
  • Programming Category: XML Programming


TXTextControl.TXTextControl.XMLNotWellFormed Event

Occurs when a loaded XML document is not well-formed. Loading the document has been aborted and the document's contents are not displayed.

Syntax

XMLNotWellFormed(FilePos, LineNumber, LinePos, Scode, Description, URL, CancelDisplay)
Parameter | Description
FilePos | Is the absolute file position in the XML document where the error occurred.
LineNumber | Is the line number in the XML document that contains the error.
LinePos | Is the character position within the line where the error occurred.
Scode | Is the OLE Status Code.
Description | Explains the reason for the error. This string can be changed.
URL | Is the URL of the XML document containing the error. If this parameter is an empty string there is no information about the URL.
CancelDisplay | Can be set to True if the application wants to display its own error string. When this parameter is not set to True, the control will display a message box showing an error string.

Data Types

FilePos: | Long
LineNumber: | Long
LinePos: | Long
Scode: | Long
Description: | String
URL: | String
CancelDisplay: | Boolean

See Also

  • Working with XML Files
  • Programming Category: XML Programming


TXTextControl.TXTextControl.Zoom Method

Zooms the contents of the TextControl using the specified option.

Introduced: 24.0.

Syntax

TXTextControl.Zoom ZoomOption
Parameter Description
ZoomOption

This parameter specifies how to zoom the document. Possible values are the following:

Constant | Description
txWholePage (1) | The zoom factor is calculated so that the current visible page becomes completely visible.
txPageWidth (2) | The zoom factor is calculated so that the complete width of a page becomes visible.
txTextWidth (3) | The zoom factor is calculated so that the complete text of a line becomes visible.

Return Value

The method returns True, if the zoom factor has been changed. Otherwise, the method returns False.

Data Types

ZoomOption: | Integer
Return value: | Boolean

See Also

  • Programming Category: Zooming


TXTextControl.TXTextControl.Zoomed Event

Occurs when the Text Control has been zoomed.

Syntax

Zoomed( )

See Also

  • ZoomFactor Property
  • Programming Category: Zooming


TXTextControl.TXTextControl.ZoomFactor Property

Specifies the zoom factor for a Text Control. The value is specified as a percentage in the range of 10..65535%, when the ViewMode property has been set to 0 - Normal View or 2 - Page View. Otherwise the zoom factor is limited to 10..400%.

Syntax

TXTextControl.ZoomFactor [= value]

Data Types

Integer.

See Also

  • PrintZoom Property
  • Programming Category: Zooming


TXTextControl.TXButtonBar Control

A TXButtonBar control represents a button bar for a Text Control. It offers several combo boxes and buttons and can be designed by the programmer.

Syntax

TXButtonBar

Properties

Property | Description
Appearance | Returns or sets the paint style of a button bar.
BorderStyle | Returns or sets the border style for a button bar.
DisplayColor | This property gets or sets the display colors of a button bar.
Enabled | Returns or sets a value that determines whether a button bar can respond to user-generated events.
hWnd | Returns a handle to a button bar.
Language | Determines the language in which button bar displays resources.
PosControlChars | Returns or sets the position of the control char button.
PosDecreaseIndent | Returns or sets the position of a button which decreases the left indent of all selected paragraphs.
PosFontBold | Returns or sets the position of the bold button.
PosFontItalic | Returns or sets the position of the italic button.
PosFontName | Returns or sets the position of the font name combo-box.
PosFontSize | Returns or sets the position of the font size combo-box.
PosFontUnderline | Returns or sets the position of the underline button.
PosGrowFont | Returns or sets the position of a button which grows the font sizes of all selected fonts.
PosIncreaseIndent | Returns or sets the position of a button which increases the left indent of all selected paragraphs.
PosLeftToRight | Returns or sets the position of a button for setting the left to right writing direction.
PosListBulleted | Returns or sets the position of the button for bulleted lists.
PosListNumbered | Returns or sets the position of the button for numbered lists.
PosListStructured | Returns or sets the position of the button for structured numbered lists.
PosParaCentered | Returns or sets the position of the button for centering paragraphs.
PosParaJustified | Returns or sets the position of the button for justifying paragraphs.
PosParaLeft | Returns or sets the position of the button for left aligning paragraphs.
PosParaRight | Returns or sets the position of the button for right aligning paragraphs.
PosRightToLeft | Returns or sets the position of a button for setting the right to left writing direction.
PosShrinkFont | Returns or sets the position of a button which shrinks the font sizes of all selected fonts.
PosStrikethru | Returns or sets the position of a button for setting the strike through attribute.
PosStyle | Returns or sets the position of the formatting styles combobox.
PosSubscript | Returns or sets the position of a button for setting text to subscript.
PosSuperscript | Returns or sets the position of a button for setting text to superscript.
PosTabCentered | Returns or sets the position of the button for setting centered tabs.
PosTabDecimal | Returns or sets the position of the button for setting decimal tabs.
PosTabLeft | Returns or sets the position of the button for setting left aligned tabs.
PosTabRight | Returns or sets the position of the button for setting right aligned tabs.
PosTabSelect | Returns or sets the position of the button for selecting the tab type.
PosXMLAdd | Returns or sets the position of a combobox showing all insertable XML elements.
PosXMLRemove | Returns or sets the position of a combobox showing all removeable XML elements.
PosZoom | Returns or sets the position of the zoom combobox.
ReadOnly | Returns or sets a value determining the button bar's read only mode.
ResourceFile | Returns or sets the file name of a resource library which button bar loads to display resources like buttons.
RightToLeft | Returns or sets a value specifying whether the button bar's buttons are shown from right to left or from left to right.
Style | Returns or sets the paint style of a button bar's buttons.

Events

Event | Description
MouseDown | Occurs when the user presses a mouse button.
MouseMove | Occurs when the user moves the mouse.
MouseUp | Occurs when the user releases a mouse button.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.Appearance Property

Returns or sets the paint style of a button bar.

Syntax

   TXButtonBar.Appearance [= value]
Setting | Description
0 - txFlat | Flat. Paints the button bar without visual effects.
1 - tx3D | (Default). 3D. Paints the button bar with three-dimensional effects.
2 - txXP | Paints the button bar's buttons in Windows XP look.
3 - txColorScheme | The button bar has a light to dark variation in background color. The color depends on the current system settings.

Data Types

Integer.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.BorderStyle Property

Returns or sets the border style for a button bar.

Syntax

   TXButtonBar.BorderStyle [= value]
Setting | Description
0 - None | The button bar has no border.
1 - Fixed Single | The button bar has a fixed border.

Data Types

Integer.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.DisplayColor Property

This property gets or sets the display colors of a button bar. By default the display colors depend on sytem colors. With this property all colors can be individually designed. The colors are only used when the button bar's Appearance and Style property has been set to txColorScheme.

Introduced: 15.1.

Syntax

TXButtonBar.DisplayColor(index) [= color]
Parameter | Description
index | Determines the index of the display element the color of which is changed. It must be a value of the ButtonBarColor enumeration. Possible values are listed in Constants.

Constants

Valid values for the index parameter are:

Constant | Description
bbForeColor (0) | Gets or sets the color used for text and the button images.
bbBackColor (1) | Gets or sets the background color at the left edge of the button bar.
bbGradientBackColor (2) | Gets or sets the background color at the right edge of the button bar.
bbSeparatorColorLight (3) | Gets or sets the color of the dark part of a separator.
bbSeparatorColorDark (4) | Gets or sets the color of the light part of a separator.
bbComboboxBackColor (5) | Gets or sets the background color of the combo boxes.
bbButtonBackColorTop (6) | Gets or sets the background color at the top of a button.
bbButtonBackColorMiddle (7) | Gets or sets the background color in the middle of a button.
bbButtonBackColorBottom (8) | Gets or sets the background color at the bottom of a button.
bbButtonHotTrackTop (9) | Gets or sets the background color at the top of a button, if the mouse cursor is over the button.
bbButtonHotTrackBottom (10) | Gets or sets the background color at the bottom of a button, if the mouse cursor is over the button.
bbButtonSelectedTop (11) | Gets or sets the background color at the top of a button used when the button is selected.
bbButtonSelectedBottom (12) | Gets or sets the background color at the bottom of a button used when the button is selected.
bbButtonPressedTop (13) | Gets or sets the background color at the top of a button used when the button is pressed down.
bbButtonPressedBottom (14) | Gets or sets the background color at the bottom of a button used when the button is pressed down.
bbButtonFrameColor (15) | Gets or sets the frame color of a selected or pressed button.

Data Types

index: | Integer
Property value: | Long

Limitations

Run time only.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.Enabled Property

Returns or sets a value that determines whether a button bar can respond to user-generated events.

Syntax

   TXButtonBar.Enabled [= boolean]
Setting | Description
True | (Default) Allows a button bar to respond to events.
False | Prevents a button bar from responding to events.

Data Types

Boolean.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.hWnd Property

Returns a handle to a button bar.

Syntax

   TXButtonBar.hWnd

Remarks

The hWnd property is used with Windows API calls. Many Windows operating enviroment functions require the hWnd of the active window as an argument.

Data Types

Handle.

Limitations

Read only, run time only.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.Language Property

Determines the language in which button bar displays resources. The button bar has several built-in languages, additional languages can be added with the ResourceFile property. The default language is the Windows system language. See Technical Articles - Resources for more information.

Syntax

   TXButtonBar.Language [= value]
Setting | Description
33 | French
34 | Spanish
39 | Italian
41 | German (Switzerland)
43 | German (Austria)
49 | German
81 | Japanese
else | English

Data Types

Integer.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.MouseDown Event

Occurs when the user presses a mouse button.

Syntax

   TXButtonBar.MouseDown(Button, Shift, X, Y)
Parameter Description
Button

Informs which button is pressed. Possible values are the following:

Value | Description
1 | The left button is pressed.
2 | The right button is pressed.
4 | The middle button is pressed.
Shift

Informs about the state of the SHIFT, CTRL and ALT keys at the time of the event. It is the sum of one or more of the following values:

Value | Description
1 | The SHIFT key was pressed at the time of the event.
2 | The CTRL key was pressed at the time of the event.
4 | The ALT key was pressed at the time of the event.
X,Y

Specifies the current location of the mouse pointer. The coordinates are relative to the upper-left corner of the button bar.

Data Types

Button: | Integer
Shift: | Integer
X: | Long
Y: | Long

See Also

  • MouseMove Event
  • MouseUp Event
  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.MouseMove Event

Occurs when the user moves the mouse.

Syntax

TXButtonBar.MouseMove(Button, Shift, X, Y)
Parameter Description
Button

Informs about the state of the mouse buttons at the time of the event. It is the sum of one or more of the following values:

Value | Description
1 | The left button is pressed.
2 | The right button is pressed.
4 | The middle button is pressed.
Shift

Informs about the state of the SHIFT, CTRL and ALT keys at the time of the event. It is the sum of one or more of the following values:

Value | Description
1 | The SHIFT key was pressed at the time of the event.
2 | The CTRL key was pressed at the time of the event.
4 | The ALT key was pressed at the time of the event.
X,Y

Specifies the current location of the mouse pointer. The coordinates are relative to the upper-left corner of the button bar.

Data Types

Button: | Integer
Shift: | Integer
X: | Long
Y: | Long

See Also

  • MouseDown Event
  • MouseUp Event
  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.MouseUp Event

Occurs when the user releases a mouse button.

Syntax

TXButtonBar.MouseUp(Button, Shift, X, Y)
Parameter Description
Button

Informs which button is pressed. Possible values are the following:

Value | Description
1 | The left button is pressed.
2 | The right button is pressed.
4 | The middle button is pressed.
Shift

Informs about the state of the SHIFT, CTRL and ALT keys at the time of the event. It is the sum of one or more of the following values:

Value | Description
1 | The SHIFT key was pressed at the time of the event.
2 | The CTRL key was pressed at the time of the event.
4 | The ALT key was pressed at the time of the event.
X,Y

Specifies the current location of the mouse pointer. The coordinates are relative to the upper-left corner of the button bar.

Data Types

Button: | Integer
Shift: | Integer
X: | Long
Y: | Long

See Also

  • MouseDown Event
  • MouseMove Event
  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosControlChars Property

Returns or sets the position of the control char button. All of the Posxxx properties can be used to configure the order and the appearance of all buttons and comboboxes currently available. The position values are position numbers beginning with number 1. A position number of zero indicates that the button or combo box is currently hidden. To group buttons or combo boxes of similar features, a gap between two elements can be created by adding the constant value 1000 to the position number of a certain button. This creates a gap between the specified element and its preceding element. Adding the constant 2000, creates a gap with a vertical group mark. Vertical group marks are only displayed if the button bar's Style property has been set to txFlat.

Syntax

   TXButtonBar.PosControlChars [= position number]

Remarks

The following two list describes which property belongs to which button bar element. The order of the first list is the same order the elements appear by default. The elements of the second list are hidden by default (position number 0):

Property | Element
PosStyle | Defines the position of the formatting styles combobox.
PosFontName | Defines the position of the font name combo-box.
PosFontSize | Defines the position of the font size combo-box.
PosFontBold | Defines the position of the bold button.
PosFontItalic | Defines the position of the italic button.
PosFontUnderline | Defines the position of the underline button.
PosParaLeft | Defines the position of the button for left aligning paragraphs.
PosParaRight | Defines the position of the button for right aligning paragraphs.
PosParaCentered | Defines the position of the button for centering paragraphs.
PosParaJustified | Defines the position of the button for justifying paragraphs.
PosListNumbered | Defines the position of the button for numbered lists.
PosListBulleted | Defines the position of the button for bulleted lists.
PosListStructured | Defines the position of the button for structured numbered lists.
PosTabSelect | Defines the position of the button for selecting the tab type.
PosControlChars | Defines the position of the control char button.
Property | Element
PosDecreaseIndent | Defines the position of the button to decrease the left indent of all selected paragraphs.
PosGrowFont | Defines the position of the button to grow the size of all selected fonts.
PosIncreaseIndent | Defines the position of the button to increase the left indent of all selected paragraphs.
PosLeftToRight | Defines the position of the button to set the left to right writing direction.
PosRightToLeft | Defines the position of the button to set the right to left writing direction.
PosShrinkFont | Defines the position of the button to shrink the size of all selected fonts.
PosStrikethru | Defines the position of the button for setting the strike out attribute.
PosSubscript | Defines the position of the button to subscript text.
PosSuperscript | Defines the position of the button to superscript text.
PosTabLeft | Defines the position of the button for setting left aligned tabs.
PosTabRight | Defines the position of the button for setting right aligned tabs.
PosTabCentered | Defines the position of the button for setting centered tabs.
PosTabDecimal | Defines the position of the button for setting decimal tabs.
PosXMLAdd | Defines the position of a combobox showing all insertable XML elements. Can be used only with XML documents.
PosXMLRemove | Defines the position of a combobox showing all removeable XML elements. Can be used only with XML documents.
PosZoom | Defines the position of the zoom combobox.

Data Types

Integer.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosDecreaseIndent Property

Returns or sets the position of a button which decreases the left indent of all selected paragraphs. See the PosControlChars and the TXTextControl.DecreaseIndent properties for more information.

Introduced: 16.0.

Syntax

   TXButtonBar.PosDecreaseIndent [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosFontBold Property

Returns or sets the position of the bold button. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosFontBold [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosFontItalic Property

Returns or sets the position of the italic button. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosFontItalic [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosFontName Property

Returns or sets the position of the font name combo-box. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosFontName [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosFontSize Property

Returns or sets the position of the font size combo-box. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosFontSize [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosFontUnderline Property

Returns or sets the position of the underline button. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosFontUnderline [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosGrowFont Property

Returns or sets the position of a button which grows the font sizes of all selected fonts. See the PosControlChars and the TXTextControl.GrowFont properties for more information.

Introduced: 16.0.

Syntax

   TXButtonBar.PosGrowFont [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosIncreaseIndent Property

Returns or sets the position of a button which increases the left indent of all selected paragraphs. See the PosControlChars and the TXTextControl.IncreaseIndent properties for more information.

Introduced: 16.0.

Syntax

   TXButtonBar.PosIncreaseIndent [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosLeftToRight Property

Returns or sets the position of a button for setting the left to right writing direction. See the PosControlChars and the TXTextControl.TextDirection properties for more information.

Introduced: 20.0.

Syntax

   TXButtonBar.PosLeftToRight [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosListBulleted Property

Returns or sets the position of the button for bulleted lists. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosListBulleted [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosListNumbered Property

Returns or sets the position of the button for numbered lists. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosListNumbered [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosListStructured Property

Returns or sets the position of the button for structured numbered lists. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosListStructured [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosParaCentered Property

Returns or sets the position of the button for centering paragraphs. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosParaCentered [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosParaJustified Property

Returns or sets the position of the button for justifying paragraphs. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosParaJustified [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosParaLeft Property

Returns or sets the position of the button for left aligning paragraphs. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosParaLeft [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosParaRight Property

Returns or sets the position of the button for right aligning paragraphs. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosParaRight [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosRightToLeft Property

Returns or sets the position of a button for setting the right to left writing direction. See the PosControlChars and the TXTextControl.TextDirection properties for more information.

Introduced: 20.0.

Syntax

   TXButtonBar.PosRightToLeft [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosShrinkFont Property

Returns or sets the position of a button which shrinks the font sizes of all selected fonts. See the PosControlChars and the TXTextControl.ShrinkFont properties for more information.

Introduced: 16.0.

Syntax

   TXButtonBar.PosShrinkFont [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosStrikethru Property

Returns or sets the position of a button for setting the strike through attribute. See the PosControlChars and the TXTextControl.FontStrikethru properties for more information.

Introduced: 20.0.

Syntax

   TXButtonBar.PosStrikethru [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosStyle Property

Returns or sets the position of the formatting styles combobox. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosStyle [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosSubscript Property

Returns or sets the position of a button for setting text to subscript. See the PosControlChars property for more information.

Introduced: 20.0.

Syntax

   TXButtonBar.PosSubscript [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosSuperscript Property

Returns or sets the position of a button for setting text to superscript. See the PosControlChars property for more information.

Introduced: 20.0.

Syntax

   TXButtonBar.PosSuperscript [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosTabCentered Property

Returns or sets the position of the button for setting centered tabs. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosTabCentered [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosTabDecimal Property

Returns or sets the position of the button for setting decimal tabs. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosTabDecimal [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosTabLeft Property

Returns or sets the position of the button for setting left aligned tabs. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosTabLeft [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosTabRight Property

Returns or sets the position of the button for setting right aligned tabs. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosTabRight [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosTabSelect Property

Returns or sets the position of the button for selecting the tab type. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosTabSelect [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosXMLAdd Property

Returns or sets the position of a combobox showing all insertable XML elements. It can be used only with XML documents. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosXMLAdd [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosXMLRemove Property

Returns or sets the position of a combobox showing all removeable XML elements. Can be used only with XML documents. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosXMLRemove [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.PosZoom Property

Returns or sets the position of the zoom combobox. See the PosControlChars property for more information.

Syntax

   TXButtonBar.PosZoom [= position number]

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.ReadOnly Property

Returns or sets a value determining the button bar's read only mode. When the button bar is set to read only, it still shows all formatting attributes of the connected TextControl, but formatting attributes cannot be changed.

Introduced: 24.0.

Syntax

TXButtonBar.ReadOnly [= boolean]
Setting | Description
True | Formatting attributes cannot be changed.
False | (Default) Formatting attributes can be changed.

Data Types

Boolean.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.ResourceFile Property

Returns or sets the file name of a resource library which button bar loads to display resources like buttons. The file name must include a complete path. When a resource library is set, the value of the Language property is ignored. See the chapter Technical Articles - Resources for more information. To avoid compatibility errors, resource libraries should have a unique file name and should be placed in the same directory as the application's executable file.

Syntax

   TXButtonBar.ResourceFile [= string]

Data Types

String.

Limitations

Run time only.

See Also

  • Language Property
  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.RightToLeft Property

Returns or sets a value specifying whether the button bar's buttons are shown from right to left or from left to right. If this property is set at runtime, its control window is recreated and must be newly assigned to the TXTextControl.ButtonBarHandle property.

Introduced: 20.0.

Syntax

   TXButtonBar.RightToLeft [= boolean]
Setting | Description
False | (Default) Shows the button bar's buttons from left to right.
True | Shows the button bar's buttons from right to left.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXButtonBar.Style Property

Returns or sets the paint style of a button bar's buttons.

Syntax

   TXButtonBar.Style [= value]
Setting | Description
0 - txFlat | Flat. Paints the button bar's buttons without visual effects.
1 - tx3D | (Default) 3D. Paints the button bar's buttons with three-dimensional effects.
2 - txXP | Paints the button bar's buttons in Windows XP look.
3 - txColorScheme | The button bar's buttons have a light to dark variation in background color. The color depends on the current system settings.

Data Types

Integer.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXRulerBar Control

A TXRulerBar control represents a ruler bar for a Text Control. It cab be used to set paragraph attributes like indents and tabulators and the horizontal alignment of table cells.

Syntax

TXRulerBar

Properties

Property | Description
Appearance | Returns or sets the paint style of a ruler bar.
BorderStyle | Returns or sets the border style for a ruler bar.
Direction | Gets or sets a value specifying the direction of the ruler bar in the document.
DisplayColor | This property gets or sets the display colors of a ruler bar.
Enabled | Returns or sets a value that determines whether a ruler bar can respond to user-generated events.
EnablePageMargins | Enables or disables the setting of page margins.
hWnd | Returns a handle to a ruler bar.
Language | Determines the language in which resources are displayed.
ReadOnly | Returns or sets a value determining the ruler bar's read only mode.
ResourceFile | Returns or sets the file name of a resource library which are loaded to display resources.
RightToLeft | Returns or sets a value specifying whether the ruler bar has its origin at the right or at the left border.
ScaleUnits | Returns or sets the scale units for the ruler.

Events

Event | Description
MouseDown | Occurs when the user presses a mouse button.
MouseMove | Occurs when the user moves the mouse.
MouseUp | Occurs when the user releases a mouse button.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXRulerBar.Appearance Property

Returns or sets the paint style of a ruler bar.

Syntax

TXRulerBar.Appearance [= value]
Setting | Description
0 - txFlat | Flat. Paints the ruler bar in a flat design.
1 - tx3D | (Default). 3D. Paints the ruler bar with three-dimensional effects.
2 - txXP | Paints the ruler bar in Windows XP look.
3 - txColorScheme | The ruler bar has a flat design and a background color depending on the color scheme currently set through the system settings.

Data Types

Integer.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXRulerBar.BorderStyle Property

Returns or sets the border style for a ruler bar.

Syntax

   TXRulerBar.BorderStyle [= value]
Setting | Description
0 - None | The ruler bar has no border.
1 - Fixed Single | The ruler bar has a fixed border.

Data Types

Integer.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXRulerBar.Direction Property

Gets or sets a value specifying the direction of the ruler bar in the document. Depending on the direction either a horizontal or a vertical ruler is displayed.

Introduced: 13.0.

Syntax

TXRulerBar.Direction [= value]
Setting | Description
0 - txHorizontal | (Default). Paints a horizontal ruler bar.
1 - txVertical | Paints a vertical ruler bar.

Data Types

Integer.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXRulerBar.DisplayColor Property

This property gets or sets the display colors of a ruler bar. By default the display colors depend on sytem colors. With this property all colors can be individually designed. The colors are only used when the ruler bar's Appearance property has been set to txColorScheme.

Introduced: 15.1.

Syntax

TXButtonBar.DisplayColor(index) [= color]
Parameter | Description
index | Determines the index of the display element the color of which is changed. It must be a value of the RulerBarColor enumeration. Possible values are listed in Constants.

Constants

Valid values for the index parameter are:

Constant | Description
rlForeColor (0) | Gets or sets the color used for the numbers of the ruler.
rlBackColor (1) | Gets or sets the background color at the left or top edge of the ruler bar.
rlGradientBackColor (2) | Gets or sets the background color at the right or bottom edge of the ruler bar.
rlSeparatorColorLight (3) | Gets or sets the color of light separators.
rlSeparatorColorDark (4) | Gets or sets the color of dark separators.
rlRulerColor (5) | Gets or sets the color of the ruler.

Data Types

index: | Integer
Property value: | Long

Limitations

Run time only.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXRulerBar.Enabled Property

Returns or sets a value that determines whether a ruler bar can respond to user-generated events.

Syntax

TXRulerBar.Enabled [= boolean]
Setting | Description
True | (Default) Allows a ruler bar to respond to events.
False | Prevents a ruler bar from responding to events.

Data Types

Boolean.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXRulerBar.EnablePageMargins Property

Enables or disables the setting of page margins. If the property's value is true, the setting of page margins is enabled.

Introduced: 13.0.

Syntax

TXRulerBar.EnablePageMargins [= boolean]
Setting | Description
True | (Default) Allows a ruler bar to set page margins.
False | The setting of page margins is disabled.

Data Types

Boolean.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXRulerBar.hWnd Property

Returns a handle to a ruler bar.

Syntax

TXRulerBar.hWnd

Remarks

The hWnd property is used with Windows API calls. Many Windows operating enviroment functions require the hWnd of the active window as an argument.

Data Types

Handle.

Limitations

Read only, run time only.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXRulerBar.Language Property

Determines the language in which resources are displayed. There are several built-in languages, additional languages can be added with the ResourceFile property. The default language is the Windows system language. See Technical Articles - Resources for more information.

Syntax

   TXRulerBar.Language [= value]
Setting | Description
33 | French
34 | Spanish
39 | Italian
41 | German (Switzerland)
43 | German (Austria)
49 | German
81 | Japanese
else | English

Data Types

Integer.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXRulerBar.ReadOnly Property

Returns or sets a value determining the ruler bar's read only mode. When the ruler bar is set to read only, it still shows all formatting attributes of the connected TextControl, but formatting attributes cannot be changed.

Introduced: 24.0.

Syntax

TXRulerBar.ReadOnly [= boolean]
Setting | Description
True | Formatting attributes cannot be changed.
False | (Default) Formatting attributes can be changed.

Data Types

Boolean.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXRulerBar.ResourceFile Property

Returns or sets the file name of a resource library which are loaded to display resources. The file name must include a complete path. When a resource library is set, the value of the Language property is ignored. See the chapter Technical Articles - Resources for more information. To avoid compatibility errors, resource libraries should have a unique file name and should be placed in the same directory as the application's executable file.

Syntax

TXRulerBar.ResourceFile [= string]

Data Types

String.

Limitations

Run time only.

See Also

  • Language Property
  • Programming Category: Tool Bars


TXTextControl.TXRulerBar.ScaleUnits Property

Returns or sets the scale units for the ruler.

Syntax

   TXRulerBar.ScaleUnits [= value]
Setting | Description
0 | mm
1 | cm
2 | inch

Data Types

Integer.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXRulerBar.MouseDown Event

Occurs when the user presses a mouse button.

Syntax

   TXRulerBar.MouseDown(Button, Shift, X, Y)
Parameter Description
Button

Informs which button is pressed. Possible values are the following:

Value | Description
1 | The left button is pressed.
2 | The right button is pressed.
4 | The middle button is pressed.
Shift

Informs about the state of the SHIFT, CTRL and ALT keys at the time of the event. It is the sum of one or more of the following values:

Value | Description
1 | The SHIFT key was pressed at the time of the event.
2 | The CTRL key was pressed at the time of the event.
4 | The ALT key was pressed at the time of the event.
X,Y

Specifies the current location of the mouse pointer. The coordinates are relative to the upper-left corner of the ruler bar.

Data Types

Button: | Integer
Shift: | Integer
X: | Long
Y: | Long

See Also

  • MouseMove Event
  • MouseUp Event
  • Programming Category: Tool Bars


TXTextControl.TXRulerBar.MouseMove Event

Occurs when the user moves the mouse.

Syntax

TXRulerBar.MouseMove(Button, Shift, X, Y)
Parameter Description
Button

Informs about the state of the mouse buttons at the time of the event. It is the sum of one or more of the following values:

Value | Description
1 | The left button is pressed.
2 | The right button is pressed.
4 | The middle button is pressed.
Shift

Informs about the state of the SHIFT, CTRL and ALT keys at the time of the event. It is the sum of one or more of the following values:

Value | Description
1 | The SHIFT key was pressed at the time of the event.
2 | The CTRL key was pressed at the time of the event.
4 | The ALT key was pressed at the time of the event.
X,Y

Specifies the current location of the mouse pointer. The coordinates are relative to the upper-left corner of the ruler bar.

Data Types

Button: | Integer
Shift: | Integer
X: | Long
Y: | Long

See Also

  • MouseDown Event
  • MouseUp Event
  • Programming Category: Tool Bars


TXTextControl.TXRulerBar.MouseUp Event

Occurs when the user releases a mouse button.

Syntax

TXRulerBar.MouseUp(Button, Shift, X, Y)
Parameter Description
Button

Informs which button is pressed. Possible values are the following:

Value | Description
1 | The left button is pressed.
2 | The right button is pressed.
4 | The middle button is pressed.
Shift

Informs about the state of the SHIFT, CTRL and ALT keys at the time of the event. It is the sum of one or more of the following values:

Value | Description
1 | The SHIFT key was pressed at the time of the event.
2 | The CTRL key was pressed at the time of the event.
4 | The ALT key was pressed at the time of the event.
X,Y

Specifies the current location of the mouse pointer. The coordinates are relative to the upper-left corner of the ruler bar.

Data Types

Button: | Integer
Shift: | Integer
X: | Long
Y: | Long

See Also

  • MouseDown Event
  • MouseMove Event
  • Programming Category: Tool Bars


TXTextControl.TXRulerBar.RightToLeft Property

Returns or sets a value specifying whether the ruler bar has its origin at the right or at the left border. If this property is set at runtime, its control window is recreated and must be newly assigned to the TXTextControl.RulerHandle property.

Introduced: 20.0.

Syntax

   TXRulerBar.RightToLeft [= boolean]
Setting | Description
False | (Default) Shows the ruler bar with an origin at the left border.
True | Shows the ruler bar with an origin at the right border.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar Control

A TXStatusBar control represents a status bar for a Text Control. It shows the page, line and column number of the current text input position, the zoom factor and some key states. Furthermore it can display an info text.

Syntax

TXStatusBar

Properties

Property | Description
Appearance | Returns or sets the paint style of a status bar.
BorderStyle | Returns or sets the border style for a status bar.
DisplayColor | This property gets or sets the display colors of a status bar.
Enabled | Returns or sets a value that determines whether a status bar can respond to user-generated events.
FontBold | Returns or sets the bold font style.
FontItalic | Returns or sets the italic font style.
FontName | Returns or sets the font used to display text.
FontSize | Returns or sets the pointsize, in twips, of the font used to display text.
FontStrikethru | Returns or sets the strikethru font style.
FontUnderline | Returns or sets the underline font style.
hWnd | Returns a handle to a status bar.
Language | Determines the language in which a status bar displays resources.
PageMode | Returns or sets the status of the StatusBar's 'Page' field.
ResourceFile | Returns or sets the file name of a resource library which status bar loads to display resources.
RightToLeft | Returns or sets a value specifying whether the status bar's display areas are shown from right to left or from left to right.
ShowColumn | Specifies whether the status bar shows the column number of the current text input position.
ShowLine | Specifies whether the status bar shows the line number of the current text input position.
ShowLocale | Specifies whether the status bar shows the language of the text selection or the text input position.
ShowPage | Specifies whether the status bar shows the page number of the current text input position.
ShowPageCounter | Specifies whether the status bar shows the number of pages in the document.
ShowSection | Specifies whether the status bar shows the section number of the current text input position.
ShowSectionCounter | Specifies whether the status bar shows the number of sections in the document.
ShowZoomTrackBar | Specifies whether the status bar shows a track bar instead of a simple number to show and to set the zooming factor.
Text | Returns or sets the info text of a status bar.
TextColumn | Returns or sets the text which appears in the Column field in front of the column number.
TextLine | Returns or sets the text which appears in the Line field in front of the line number.
TextPage | Returns or sets the text which appears in the Page field in front of the page number.
TextPageCounter | Returns or sets the text which appears in front of the page counter.
TextSection | Returns or sets the text which appears in the Section field in front of the section number.
TextSectionCounter | Returns or sets the text which appears in front of the section counter.

Events

Event | Description
MouseDown | Occurs when the user presses a mouse button.
MouseMove | Occurs when the user moves the mouse.
MouseUp | Occurs when the user releases a mouse button.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.Appearance Property

Returns or sets the paint style of a status bar.

Introduced: 13.0.

Syntax

TXStatusBar.Appearance [= value]
Setting | Description
0 - sbFlat | Flat. Paints the status bar in a flat design.
1 - sb3D | (Default). 3D. Paints the status bar with three-dimensional effects.
2 - sbXP | Paints the status bar in Windows XP look.
3 - sbColorScheme | The status bar has a flat design and a background color with a horizontal color gradient. It depends on the color scheme currently set through the system settings or on individual user settings.
4 - sbVerticalColorScheme | The status bar has a flat design and a background color with a vertical color gradient. It depends on the color scheme currently set through the system settings or on individual user settings.

Data Types

Integer.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.BorderStyle Property

Returns or sets the border style for a status bar.

Syntax

TXStatusBar.BorderStyle [= value]
Setting | Description
0 - None | The status bar has no border.
1 - Fixed Single | The status bar has a fixed border.

Data Types

Integer.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.DisplayColor Property

This property gets or sets the display colors of a status bar. By default the display colors depend on sytem colors. With this property all colors can be individually designed. The colors are only used when the status bar's Appearance property has been set to txColorScheme or txVerticalColorScheme.

Introduced: 15.1.

Syntax

TXStatusBar.DisplayColor(index) [= color]
Parameter | Description
index | Determines the index of the display element the color of which is changed. It must be a value of the StatusBarColor enumeration. Possible values are listed in Constants.

Constants

Valid values for the index parameter are:

Constant | Description
sbForeColor (0) | Gets or sets the color used for text and numbers.
sbBackColor (1) | Gets or sets the background color at the left edge of the status bar. This color is only used, if the Appearance property has been set to txColorScheme.
sbGradientBackColor (2) | Gets or sets the background color at the right edge of the status bar. This color is only used, if the Appearance property has been set to txColorScheme.
sbFrameColor (3) | Gets or sets the color of the status bar's frames. This color is only used, if the Appearance property has been set to txColorScheme.
sbBackColorTop (4) | Gets or sets the background color at the top of the status bar. This color is only used, if the Appearance property has been set to txVerticalColorScheme.
sbBackColorMiddle (5) | Gets or sets the background color in the middle of the status bar. This color is only used, if the Appearance property has been set to txVerticalColorScheme.
sbBackColorBottom (6) | Gets or sets the background color at the bottom of the status bar. This color is only used, if the Appearance property has been set to txVerticalColorScheme.
sbSeparatorColorLight (7) | Gets or sets the color of the dark part of a separator. This color is only used, if the Appearance property has been set to txVerticalColorScheme.
sbSeparatorColorDark (8) | Gets or sets the color of the light part of a separator. This color is only used, if the Appearance property has been set to txVerticalColorScheme.

Data Types

index: | Integer
Property value: | Long

Limitations

Run time only.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.Enabled Property

Returns or sets a value that determines whether a status bar can respond to user-generated events.

Syntax

   TXStatusBar.Enabled [= boolean]
Setting | Description
True | (Default) Allows a status bar to respond to events.
False | Prevents a status bar from responding to events.

Data Types

Boolean.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.FontBold Property

Returns or sets the bold font style.

Syntax

TXStatusBar.FontBold [= value]
Setting | Description
0 | The characters are not formatted with the bold font style.
1 | The characters are formatted with the bold font style.

Data Types

Integer.

See Also

  • FontName Property
  • FontSize Property
  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.FontName Property

Returns or sets the font used to display text.

Syntax

TXStatusBar.FontName [= string]

Data Types

String.

See Also

  • FontSize Property
  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.FontSize Property

Returns or sets the pointsize, in twips, of the font used to display text.

Syntax

TXStatusBar.FontSize [= value]

Data Types

Integer.

See Also

  • FontName Property
  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.FontItalic Property

Returns or sets the italic font style.

Syntax

TXStatusBar.FontItalic [= value]
Setting | Description
0 | The characters are not formatted with the italic font style.
1 | The characters are formatted with the italic font style.

Data Types

Integer.

See Also

  • FontName Property
  • FontSize Property
  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.FontStrikethru Property

Returns or sets the strikethru font style.

Syntax

TXStatusBar.FontStrikethru [= value]
Setting | Description
0 | The characters are not formatted with the strikethru font style.
1 | The characters are formatted with the strikethru font style.

Data Types

Integer.

See Also

  • FontName Property
  • FontSize Property
  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.FontUnderline Property

Returns or sets the underline font style.

Syntax

TXStatusBar.FontUnderline [= value]
Setting | Description
0 | The characters are not formatted with the underline font style.
1 | The characters are formatted with the underline font style.

Data Types

Integer.

See Also

  • FontName Property
  • FontSize Property
  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.hWnd Property

Returns a handle to a status bar.

Syntax

   TXStatusBar.hWnd

Remarks

The hWnd property is used with Windows API calls. Many Windows operating enviroment functions require the hWnd of the active window as an argument.

Data Types

Handle.

Limitations

Read only, run time only.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.Language Property

Determines the language in which a status bar displays resources. The status bar has several built-in languages, additional languages can be added with the ResourceFile property. The default language is the Windows system language. See Technical Articles - Resources for more information.

Syntax

   TXStatusBar.Language [= value]
Setting | Description
33 | French
34 | Spanish
39 | Italian
41 | German (Switzerland)
43 | German (Austria)
49 | German
81 | Japanese
else | English

Data Types

Integer.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.MouseDown Event

Occurs when the user presses a mouse button.

Syntax

   TXStatusBar.MouseDown(Button, Shift, X, Y)
Parameter Description
Button

Informs which button is pressed. Possible values are the following:

Value | Description
1 | The left button is pressed.
2 | The right button is pressed.
4 | The middle button is pressed.
Shift

Informs about the state of the SHIFT, CTRL and ALT keys at the time of the event. It is the sum of one or more of the following values:

Value | Description
1 | The SHIFT key was pressed at the time of the event.
2 | The CTRL key was pressed at the time of the event.
4 | The ALT key was pressed at the time of the event.
X,Y

Specifies the current location of the mouse pointer. The coordinates are relative to the upper-left corner of the status bar.

Data Types

Button: | Integer
Shift: | Integer
X: | Long
Y: | Long

See Also

  • MouseMove Event
  • MouseUp Event
  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.MouseMove Event

Occurs when the user moves the mouse.

Syntax

TXStatusBar.MouseMove(Button, Shift, X, Y)
Parameter Description
Button

Informs about the state of the mouse buttons at the time of the event. It is the sum of one or more of the following values:

Value | Description
1 | The left button is pressed.
2 | The right button is pressed.
4 | The middle button is pressed.
Shift

Informs about the state of the SHIFT, CTRL and ALT keys at the time of the event. It is the sum of one or more of the following values:

Value | Description
1 | The SHIFT key was pressed at the time of the event.
2 | The CTRL key was pressed at the time of the event.
4 | The ALT key was pressed at the time of the event.
X,Y

Specifies the current location of the mouse pointer. The coordinates are relative to the upper-left corner of the status bar.

Data Types

Button: | Integer
Shift: | Integer
X: | Long
Y: | Long

See Also

  • MouseDown Event
  • MouseUp Event
  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.MouseUp Event

Occurs when the user releases a mouse button.

Syntax

TXStatusBar.MouseUp(Button, Shift, X, Y)
Parameter Description
Button

Informs which button is pressed. Possible values are the following:

Value | Description
1 | The left button is pressed.
2 | The right button is pressed.
4 | The middle button is pressed.
Shift

Informs about the state of the SHIFT, CTRL and ALT keys at the time of the event. It is the sum of one or more of the following values:

Value | Description
1 | The SHIFT key was pressed at the time of the event.
2 | The CTRL key was pressed at the time of the event.
4 | The ALT key was pressed at the time of the event.
X,Y

Specifies the current location of the mouse pointer. The coordinates are relative to the upper-left corner of the status bar.

Data Types

Button: | Integer
Shift: | Integer
X: | Long
Y: | Long

See Also

  • MouseDown Event
  • MouseMove Event
  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.PageMode Property

Returns or sets the status of the StatusBar's 'Page' field.

Syntax

   TXStatusBar.PageMode [= value]
Setting | Description
0 | The 'Page' field is hidden.
1 | The 'Page' field is always shown.
2 | The 'Page' field is only shown if the connected Text-Contol's ViewMode property has been set to Page View.

Data Types

Integer.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.ResourceFile Property

Returns or sets the file name of a resource library which status bar loads to display resources. The file name must include a complete path. When a resource library is set, the value of the Language property is ignored. See the chapter Technical Articles - Resources for more information. To avoid compatibility errors, resource libraries should have a unique file name and should be placed in the same directory as the application's executable file.

Syntax

TXStatusBar.ResourceFile [= string]

Data Types

String.

Limitations

Run time only.

See Also

  • Language Property
  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.RightToLeft Property

Returns or sets a value specifying whether the status bar's display areas are shown from right to left or from left to right. If this property is set at runtime, its control window is recreated and must be newly assigned to the TXTextControl.StatusBarHandle property.

Introduced: 20.0.

Syntax

   TXStatusBar.RightToLeft [= boolean]
Setting | Description
False | (Default) Shows the status bar's display areas from left to right.
True | Shows the status bar's display areas from right to left.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.ShowColumn Property

Specifies whether the status bar shows the column number of the current text input position.

Introduced: 14.0.

Syntax

TXStatusBar.ShowColumn [= value]

Data Types

Boolean.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.ShowLocale Property

Specifies whether the status bar shows the language of the text selection or the text input position.

Introduced: 20.0.

Syntax

TXStatusBar.ShowLocale [= value]

Data Types

Boolean.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.ShowLine Property

Specifies whether the status bar shows the line number of the current text input position.

Introduced: 14.0.

Syntax

TXStatusBar.ShowLine [= value]

Data Types

Boolean.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.ShowPage Property

Specifies whether the status bar shows the page number of the current text input position.

Introduced: 14.0.

Syntax

TXStatusBar.ShowPage [= value]

Data Types

Boolean.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.ShowPageCounter Property

Specifies whether the status bar shows the number of pages in the document.

Introduced: 14.0.

Syntax

TXStatusBar.ShowPageCounter [= value]

Data Types

Boolean.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.ShowSection Property

Specifies whether the status bar shows the section number of the current text input position.

Introduced: 14.0.

Syntax

TXStatusBar.ShowSection [= value]

Data Types

Boolean.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.ShowSectionCounter Property

Specifies whether the status bar shows the number of sections in the document.

Introduced: 14.0.

Syntax

TXStatusBar.ShowSectionCounter [= value]

Data Types

Boolean.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.ShowZoomTrackBar Property

Specifies whether the status bar shows a track bar instead of a simple number to show and to set the zooming factor.

Introduced: 18.0.

Syntax

TXStatusBar.ShowZoomTrackBar [= value]

Data Types

Boolean.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.Text Property

Returns or sets the info text of a status bar.

Syntax

TXStatusBar.Text [= string]

Data Types

String.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.TextColumn Property

Returns or sets the text which appears in the Column field in front of the column number.

Syntax

TXStatusBar.TextColumn [= string]

Data Types

String.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.TextLine Property

Returns or sets the text which appears in the Line field in front of the line number.

Syntax

TXStatusBar.TextLine [= string]

Data Types

String.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.TextPage Property

Returns or sets the text which appears in the Page field in front of the page number.

Syntax

TXStatusBar.TextPage [= string]

Data Types

String.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.TextPageCounter Property

Returns or sets the text which appears in front of the page counter.

Introduced: 14.0.

Syntax

TXStatusBar.TextPageCounter [= string]

Data Types

String.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.TextSection Property

Returns or sets the text which appears in the Section field in front of the section number.

Introduced: 14.0.

Syntax

TXStatusBar.TextSection [= string]

Data Types

String.

See Also

  • Programming Category: Tool Bars


TXTextControl.TXStatusBar.TextSectionCounter Property

Returns or sets the text which appears in front of the section counter.

Introduced: 14.0.

Syntax

TXStatusBar.TextSectionCounter [= string]

Data Types

String.

See Also

  • Programming Category: Tool Bars


TXTextControl.Style Object

A Style object is an OLE Automation object that represents a formatting style. To get a style or to iterate through all existing styles the Styles collection object can be used. A Style object has the following class name that can be used to create a new object with the CreateObject function:

TIS.TX.Style.24

A Style object has properties to set or to get attributes for fonts and paragraphs, frames, tabs and list settings. For paragraph-based styles all settings are possible, for character-based styles paragraph, tab and list settings cannot be used. The style's type can be obtained with the StyleType property.

Syntax

Style

Properties

Property | Description
Alignment | Returns or sets the formatting style's text alignment.
Baseline | Returns or sets the formatting style's baseline alignment.
BaselineType | Returns or sets the formatting style's baseline type.
BulletAttribute | This property returns or sets attributes for bulleted lists.
FontBold | Returns or sets the formatting style's font bold attribute.
FontItalic | Returns or sets the formatting style's font italic attribute.
FontName | Returns or sets the formatting style's font.
FontSize | Returns or sets the formatting style's font size, in twips.
FontStrikethru | Returns or sets the formatting style's font strikethru attribute.
FontUnderline | Returns or sets the formatting style's underlining attributes.
ForeColor | Returns or sets the formatting style's text color.
FrameDistance | Returns or sets the distance between the text and the frame of a paragraph, in twips.
FrameLineWidth | Returns or sets the line width of a paragraph's frame, in twips.
FrameStyle | Returns or sets the style of a paragraph's frame.
IndentB | Returns or sets the formatting style's additional bottom distance for a paragraph, in twips.
IndentFL | Returns or sets the formatting style's additional indent for the first line of a paragraph, in twips.
IndentL | Returns or sets the formatting style's left paragraph indent, in twips.
IndentR | Returns or sets the formatting style's right paragraph indent, in twips.
IndentT | Returns or sets the formatting style'additional top distance for a paragraph, in twips.
KeepLinesTogether | Gets or sets a value indicating whether a page break is allowed within a paragraph.
KeepWithNext | If this property is set to true, a paragraph with this formatting style is displayed on the same page as its following paragraph.
LineSpacing | Returns or sets the formatting style's line spacing in percent.
LineSpacingT | Returns or sets the formatting style's line spacing, in twips.
ListType | Returns or sets the formatting style's list type.
NextParaStyle | Returns or sets the name of the style used after the user has pressed the RETURN key.
NumberingAttribute | This property returns or sets attributes for numbered lists.
PageBreakBefore | If this property is set to true, a paragraph with this formatting style is always displayed on top of a page.
StyleName | Returns or sets the formatting style's name.
StyleType | Returns the formatting style's type.
TabPos | Returns or sets the formatting style's tabulator position, in twips.
TabType | Returns or sets the formatting style's tabulator type.
TextBkColor | Returns or sets the formatting style's text background color.
WidowOrphanLines | Gets or sets the number of lines for widow/orphan control.

Methods

Method | Description
Apply | Applies all style settings on the current document.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.Apply Method

Applies all style settings on the current document.

Syntax

   Style.Apply

Remarks

This method applies alls settings made since the previous Apply call or since object creation.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.Alignment Property

Returns or sets the formatting style's text alignment.

Syntax

   Style.Alignment [= value]
Setting | Description
1 | The text is left aligned.
2 | The text is right aligned.
3 | Text is centered.
4 | The text is centered.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.Baseline Property

Returns or sets the formatting style's baseline alignment. The BaselineType property determines if this property is interpreted as super- or subscript.

Syntax

   Style.Baseline [= value]

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.BaselineType Property

Returns or sets the formatting style's baseline type. For character-based styles this property can be zero to indicate that the baseline alignment is inherited from the paragraph.

Syntax

   Style.BaselineType [= value]
Setting | Description
2 | The baseline alignment is normal, neither super- nor subscript.
4 | The baseline alignment is superscript.
8 | The baseline alignment is subscript.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.BulletAttribute Property

This property returns or sets attributes for bulleted lists. A new attribute set with this property has only effect when the ListType property has previously been set to txListBulleted.

Syntax

   Style.BulletAttribute(Attribute) [= value]

Remarks

This property's parameter and settings are the same as for TXTextControl.BulletAttribute.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.FontBold Property

Returns or sets the formatting style's font bold attribute.

Syntax

   Style.FontBold [= value]
Setting | Description
0 | The text is not formatted with the font bold attribute.
1 | The text is formatted with the font bold attribute.
2 | Indicates that the font bold attribute is inherited from the paragraph's style. This value is possible only for character-based styles.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.FontItalic Property

Returns or sets the formatting style's font italic attribute.

Syntax

Style.FontItalic [= value]
Setting | Description
0 | The text is not formatted with the font italic attribute.
1 | The text is formatted with the font italic attribute.
2 | Indicates that the font italic attribute is inherited from the paragraph's style. This value is possible only for character-based styles.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.FontName Property

Returns or sets the formatting style's font. For character-based styles this can be an empty string to indicate that the font is inherited from the paragraph style.

Syntax

   Style.FontName [= FontName]

Data Types

String.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.FontSize Property

Returns or sets the formatting style's font size, in twips. For characterbased styles it can be zero to indicate that the font is inherited from the paragraph style.

Syntax

   Style.FontSize [= value]

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.FontStrikethru Property

Returns or sets the formatting style's font strikethru attribute.

Syntax

Style.FontStrikethru [= value]
Setting | Description
0 | The text is not formatted with the font strikethru attribute.
1 | The text is formatted with the font strikethru attribute.
2 | Indicates that the font strikethru attribute is inherited from the paragraph's style. This value is possible only for character-based styles.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.FontUnderline Property

Returns or sets the formatting style's underlining attributes.

Syntax

   Style.FontUnderline [= value]
Setting | Description
0 | The text is not underlined.
&H1 | The text is single underlined.
&H2 | The text is double underlined.
&H4 | Only words are underlined. This value is possible only in combination with single or double underlined.
&H8 | The text is underlined with a red zigzag line.
&H10 | Indicates that the underlining attribute is inherited from the paragraph's style. This value is possible only for character-based styles.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.ForeColor Property

Returns or sets the formatting style's text color. Text Control uses the Microsoft Windows operating enviroment red-green-blue (RGB) color scheme.

Syntax

   Style.ForeColor [= value]
Setting | Description
0 to &HFFFFFF | These values are interpreted as RGB values.
&H40000000 | The style uses the system color for the window text.
&H80000000 | The text color is inherited from the paragraph. This value is only possible for character-based styles.

Data Types

Long.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.FrameDistance Property

Returns or sets the distance between the text and the frame of a paragraph, in twips.

Syntax

   Style.FrameDistance [= value]

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.FrameLineWidth Property

Returns or sets the line width of a paragraph's frame, in twips.

Syntax

   Style.FrameLineWidth [= value]

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.FrameStyle Property

Returns or sets the style of a paragraph's frame. Possible values are the same as described for TXTextControl.FrameStyle property.

Syntax

   Style.FrameStyle [= value]

Data Types

Long.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.IndentB Property

Returns or sets the formatting style's additional bottom distance for a paragraph, in twips.

Syntax

   Style.IndentB [= value]

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.IndentFL Property

Returns or sets the formatting style's additional indent for the first line of a paragraph, in twips. This value can be negative.

Syntax

Style.IndentFL [= value]

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.IndentL Property

Returns or sets the formatting style's left paragraph indent, in twips.

Syntax

Style.IndentL [= value]

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.IndentR Property

Returns or sets the formatting style's right paragraph indent, in twips.

Syntax

Style.IndentR [= value]

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.IndentT Property

Returns or sets the formatting style'additional top distance for a paragraph, in twips.

Syntax

Style.IndentT [= value]

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.KeepLinesTogether Property

Gets or sets a value indicating whether a page break is allowed within a paragraph. If the property's value is true, a page break is not allowed. Otherwise, it is allowed.

Introduced: 13.0.

Syntax

Style.KeepLinesTogether [= boolean]

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.KeepWithNext Property

If this property is set to true, a paragraph with this formatting style is displayed on the same page as its following paragraph.

Introduced: 13.0.

Syntax

Style.KeepWithNext [= boolean]

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.LineSpacing Property

Returns or sets the formatting style's line spacing in percent.

Syntax

   Style.LineSpacing [= value]

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.LineSpacingT Property

Returns or sets the formatting style's line spacing, in twips.

Syntax

   Style.LineSpacingT [= value]

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.ListType Property

Returns or sets the formatting style's list type. Attributes for bulleted lists can be set with the BulletAttribute property and attributes for numbered lists can be set with the NumberingAttribute property.

Syntax

   Style.ListType [= Type]
Setting | Description
txListNone (1) | Resets paragraphs with bulleted or numbered list attributes to paragraphs without such features.
txListBulleted (2) | Defines a list with bullets.
txListNumbered (4) | Defines a numbered list.
txListStructured (8) | Defines a structured numbered list.

Data Types

Integer.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.NextParaStyle Property

Returns or sets the name of the style used after the user has pressed the RETURN key.

Syntax

   Style.NextParaStyle [= StyleName]

Data Types

String.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.NumberingAttribute Property

This property returns or sets attributes for numbered lists. A new attribute set with this property has only effect when the ListType property has previously been set to txListNumbered or txListStructured.

Syntax

   Style.NumberingAttribute(Attribute) [= value]

Remarks

This property's parameter and settings are the same as for TXTextControl.NumberingAttribute.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.PageBreakBefore Property

If this property is set to true, a paragraph with this formatting style is always displayed on top of a page.

Introduced: 13.0.

Syntax

Style.PageBreakBefore [= boolean]

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.StyleName Property

Returns or sets the formatting style's name. For XML documents this property is read-only.

Syntax

   Style.StyleName [= StyleName]

Data Types

String.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.StyleType Property

Returns the formatting style's type.

Syntax

   Style.StyleType
Setting | Description
1 | The style is paragraph-based.
2 | The style is character-based.

Data Types

Integer.

Limitations

Read only, Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.TabPos Property

Returns or sets the formatting style's tabulator position, in twips.

Syntax

   Style.TabPos(Index) [= value]
Parameter | Description
Index | Specifies a tabulator index. It must be between 1 and 14.

Data Types

Index: | Integer
Property value: | Integer

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.TabType Property

Returns or sets the formatting style's tabulator type.

Syntax

   Style.TabType(Index) [= value]
Parameter | Description
Index | Specifies a tabulator index. It must be between 1 and 14.

Constants

Valid constants for the property value are:

Constant | Description
1 | Left tab.
2 | Right tab.
3 | Centered tab.
4 | Decimal tab.
5 | Right tab at the right most text position. For this type any position set with the TabPos property is ignored.

Data Types

Index: | Integer
Property value: | Integer

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.TextBkColor Property

Returns or sets the formatting style's text background color. Text Control uses the Microsoft Windows operating enviroment red-green-blue (RGB) color scheme.

Syntax

   Style.TextBkColor [= value]
Setting | Description
0 to &HFFFFFF | These values are interpreted as RGB values.
&H40000000 | The style uses the system color for the window background.
&H50000000 | The style uses the control's background color.
&H80000000 | The text background color is inherited from the paragraph. This value is only possible for character-based styles.

Data Types

Long.

Limitations

Run time only.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Style.WidowOrphanLines Property

Gets or sets the number of lines for widow/orphan control. Widow/orphan control avoids that a paragraph is started at the bottom of a page and that either, the majority of its lines, or only a few lines are displayed on the next page. This property's value determines how many lines must not be separated from the rest of the paragraph. For example, if this property is set to two, there must be at least three lines of the paragraph at the bottom of the previous page and at least three lines at the top of the next page. Otherwise, the complete paragraph is displayed on the next page. If this property is set to zero, widow/orphan control is disabled.

Introduced: 13.0.

Syntax

Style.WidowOrphanLines [= value]

Limitations

The property's value must be between 0 and 3.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Styles Collection Object

A Styles collection object is an OLE Automation object whose members represent all formatting styles a Text Control document contains. The members of a Styles collection object are OLE Automation objects of the Style class. A Styles collection object can be obtained with the TXTextControl.Styles property.

Syntax

Styles

Properties

Property | Description
Count | Returns the number of Style objects in the collection which is the number of formatting styles contained in a Text Control document.

Methods

Method | Description
Item | Returns a specific Style object of a Styles collection.

See Also

  • Programming Category: Stylesheet Programming


TXTextControl.Styles.Count Property

Returns the number of Style objects in the collection which is the number of formatting styles contained in a Text Control document.

Syntax

   Styles.Count

Data Types

Long.

Limitations

Run time only.

See Also

  • Styles.Item Method
  • TextControl.Styles Property
  • Programming Category: Stylesheet Programming


TXTextControl.Styles.Item Method

Returns a specific Style object of a Styles collection.

Syntax

   Styles.Item StyleName
Parameter | Description
StyleName | Specifies the name of the style. If this value does not match any existing member of the collection, an error occurs.

Return Value

The method returns a Style object.

Data Types

StyleName: | String
Return value: | Style Object

Limitations

Run time only.

Example

The first of the following Basic examples displays the name of the font used with the Headline formatting style. The second enumerates the names of all styles and its fonts in a document. In the third example, it is shown how to change a style property programmatically:

MsgBox TXTextControl1.Styles.Item("Headline").FontName

For Each style In TXTextControl1.Styles
   Debug.Print "Style name: " + style + ", Font name: " + style.FontName
Next

Set Style = TXTextControl1.Styles.Item(TXTextControl1.StyleCurrent)
Style.FontName = "Arial"
Style.FontSize = 400
Style.Apply

See Also

  • Style Object
  • Programming Category: Stylesheet Programming


TXTextControl.XMLElement Object

An XMLElement object is an OLE Automation object that represents an element in an XML document. To iterate through all existing XML elements the XMLElements collection object can be used. An XMLElement object has the following class name that can be used to create a new object with the CreateObject function:

TIS.TX.XMLElement.24

Syntax

XMLElement

Properties

Property | Description
AutoSelect | Determines whether the text of a newly added XML element is automatically selected.
AutoText | Determines whether text is automatically created for a newly added XML element that has no text contents.
ElementName | Returns or sets the XML element's name.
Text | Returns or sets the text belonging to an XML element.

Methods

Method | Description
AddChild | Adds a new XMLElement object as a sub-element of this element.
ChildItem | Returns an XMLElement object that is a child element of this element.
RemoveChild | Removes a sub-element from this element.
Select | Selects the text of the XML element.

See Also

  • Working with XML Files
  • Programming Category: XML Programming


TXTextControl.XMLElement.AddChild Method

Adds a new XMLElement object as a sub-element of this element. The new element is placed at the position specified through the document's DTD. If this element can have more than one child of the specified type the before or after parameters can be used to specify a position.

Syntax

   XMLElement.AddChild XMLElement[, before][, after]
Parameter | Description
XMLElement | Specifies an XMLElement object.
before | Optional. Specifies a relative position in the list of child elements of the specified type. The XML element to be added is placed before the child identified by the before parameter. You can specify before or after positions but not both.
after | Optional. Specifies a relative position in the list of child elements of the specified type. The XML element to be added is placed after the child identified by the after parameter. You can specify before or after positions but not both.

Return Value

The method returns one of the following values:

Value | Description
0 | An error has occurred.
1 | The new element could not be added because the document becomes invalid according to the document's DTD. In this case Text Control fires an XMLInvalid event.
2 | The new element has been successfully added.

Example

The following Basic example creates a new "Telephone" element and adds it to the second address in an XML document that contains addresses consisting of the sub-elements Name, Street, City and Telephone:

Dim NewElement As Object
Set NewElement = CreateObject("TIS.TX.XMLElement.24")
NewElement.ElementName = "Telephone"
NewElement.Text = "034568-782346"
TXTextControl1.XMLElements("Address")(2).AddChild NewElement

See Also

  • Working with XML Files
  • XMLElement Object
  • XMLElement.RemoveChild Method
  • Programming Category: XML Programming


TXTextControl.XMLElement.AutoSelect Property

Determines whether the text of a newly added XML element is automatically selected. The value of this property is True by default.

Syntax

   XMLElement.AutoSelect [= boolean]
   Data Type:
   Boolean.

Limitations

Run time only.

See Also

  • Working with XML Files
  • Programming Category: XML Programming


TXTextControl.XMLElement.AutoText Property

Determines whether text is automatically created for a newly added XML element that has no text contents. The created text consists of the element's name enclosed in square brackets and is created only if no text has been set with the XML element's Text property. The value of this property is True by default.

Syntax

   XMLElement.AutoText [= boolean]
   Data Type:
   Boolean.

Limitations

Run time only.

See Also

  • Working with XML Files
  • Programming Category: XML Programming


TXTextControl.XMLElement.ChildItem Method

Returns an XMLElement object that is a child element of this element. If this element has more than one sub-elements of the type with the given name the optional Index parameter can be used to specify the subelement. If Index is omitted Text Control returns the first sub-element with the given name.

Syntax

   XMLElement.ChildItem ElementName[, Index]
Parameter | Description
ElementName | Specifies the name of the sub-element.
Index | Optional. Specifies the number of the subelement. If this value does not match any existing sub-element, an error occurs.

Return Value

The method returns an XMLElement object.

Example

The following Basic example gets the Telephone element from the second address in an XML document that contains addresses consisting of the sub-elements Name, Street, City and Telephone:

Dim Telephone As String
Set Addresses = TXTextControl1.XMLElements("Address")
Telephone = Addresses(2).ChildItem("Telephone")

See Also

  • Working with XML Files
  • Programming Category: XML Programming


TXTextControl.XMLElement.ElementName Property

Returns or sets the XML element's name. An element's name can only be changed for newly created elements. If an element belongs to an XML document its name cannot be changed.

Syntax

   XMLElement.ElementName [= name]
   Data Type:
   String.

Limitations

Run time only.

See Also

  • Working with XML Files
  • XMElement Object
  • Programming Category: XML Programming


TXTextControl.XMLElement.RemoveChild Method

Removes a sub-element from this element. If this element has more than one sub-element of the type with the given name, the optional Index parameter can be used to specify the sub-element to remove. If Index is omitted Text Control removes the first sub-element with the given name.

Syntax

   XMLElement.RemoveChild ElementName[, Index]
Parameter | Description
ElementName | Specifies the name of the sub-element to remove.
Index | Optional. Specifies the number of the subelement. If this value does not match any existing sub-element, an error occurs.

Return Value

The method returns one of the following values:

Value | Description
0 | An error has occurred.
1 | The element could not be removed because the document becomes invalid according to the document's DTD. In this case Text Control fires an XMLInvalid event.
2 | The sub-element has successfully been removed.

Example

The following Basic example removes the second "Telephone" element of the second address in an XML document that contains addresses consisting of the sub-elements Name, Street, City and Telephone:

TXTextControl1.XMLElements("Address")(2).RemoveChild "Telephone", 2

See Also

  • Working with XML Files
  • Programming Category: XML Programming


TXTextControl.XMLElement.Select Method

Selects the text of the XML element. The text can only be selected if the element belongs to the document.

Syntax

   XMLElement.Select

Remarks

If the element consists of several sub-elements Text Control selects the text of the first sub-element.

See Also

  • Working with XML Files
  • XMElement Object
  • Programming Category: XML Programming


TXTextControl.XMLElement.Text Property

Returns or sets the text belonging to an XML element.

Syntax

   XMLElement.Text [= Text]

Remarks

If the element consists of several sub-elements, the text parts must be separated through linefeed characters (Chr(10)).

Data Types

String.

Limitations

Run time only.

Example

The following Basic example sets the text of the second address in an XML document that contains addresses consisting of the sub-elements Name, Street and City. Because the Text property is the default property of the XMLElement object the two lines of code are equivalent:

TXTextControl1.XMLElements("Address")(2).Text = "Jack Miller" & Chr(10) _
& "Baker Street" & Chr(10) & "New York"

TXTextControl1.XMLElements("Address")(2) = "Jack Miller" & Chr(10) _
& "Baker Street" & Chr(10) & "New York"

See Also

  • Working with XML Files
  • XMElement Object
  • Programming Category: XML Programming


TXTextControl.XMLElements Collection Object

A XMLElements collection object is an OLE Automation object whose members represent all XML elements with a certain tag name. The members of an XMLElements collection object are OLE Automation objects of the class XMLElement. An XMLElements collection object can be obtained with the TXTextControl.XMLElements property.

Syntax

XMLElements

Properties

Property | Description
Count | Returns the number of XMLElement objects in the collection.
InputItemIndex | Returns the index of the element with the current input position in the collection.

Methods

Method | Description
Add | Adds a new XMLElement object to the collection.
InputItem | Returns the XML element of an XMLElements collection which contains the current input position.
Item | Returns a specific XML element of an XMLElements collection.
Remove | Removes an XML element from an XMLElements collection.

See Also

  • Working with XML Files
  • Programming Category: XML Programming


TXTextControl.XMLElements.Add Method

Adds a new XMLElement object to the collection.

Syntax

   XMLElements.Add XMLElement[, before][, after]
Parameter | Description
XMLElement | Specifies an XMLElement object.
before | Optional. Specifies a relative position in the collection. The XML element to be added is placed in the collection before the member identified by the before parameter. It must be a number from 1 to the value of the collection's Count property. If this parameter is zero, the new element is inserted before the element at the current input position. You can specify before or after positions but not both.
after | Optional. Specifies a relative position in the collection. The XML element to be added is placed in the collection after the member identified by the after parameter. It must be a number from 1 to the value of the collection's Count property. If this parameter is zero the new element is inserted after the element at the current input position. You can specify before or after positions but not both.

Return Value

Parameter | Description
0 | An error has occurred.
1 | The new element could not be added because the document becomes invalid according to the document's DTD. In this case Text Control fires an XMLInvalid event.
2 | The new element has successfully been added.

Data Types

XMLElement: | XMLElement Object
before: | Long
after: | Long
Return value: | Integer

Example

The following Basic example inserts a new Address element in an XML document that contains addresses consisting of the sub-elements Name, Street and City. The new address is inserted after the second address:

Dim NewAddress As Object
Set NewAddress = CreateObject("TIS.TX.XMLElement.24")
NewAddress.Text = "Jack Brown" & Chr(10) _
& "Baker Street" & Chr(10) & "New York"
TXTextControl1.XMLElements("Address").Add NewAddress, , 2

See Also

  • Working with XML Files
  • XMElement Object
  • XMElements Collection
  • Programming Category: XML Programming


TXTextControl.XMLElements.Count Property

Returns the number of XMLElement objects in the collection.

Syntax

   XMLElements.Count

Data Types

Long.

Limitations

Read only, run time only.

See Also

  • Working with XML Files
  • XMElements.Add Method
  • XMElements.Item Method
  • Programming Category: XML Programming


TXTextControl.XMLElements.InputItem Method

Returns the XML element of an XMLElements collection which contains the current input position.

Syntax

XMLElements.InputItem

Return Value

The method returns an XMLElement object. If the current input position is not in an element of this collection no object is returned.

Data Types

Return value: XMLElement Object.

See Also

  • Working with XML Files
  • XMElement Object
  • XMLElements Collection
  • Programming Category: XML Programming


TXTextControl.XMLElements.InputItemIndex Property

Returns the index of the element with the current input position in the collection. The property value is zero if the current input position is in no element of this collection.

Syntax

   XMLElements.InputItemIndex

Data Types

Long.

Limitations

Read only, run time only.

See Also

  • Working with XML Files
  • XMElements.InputItem Method
  • XMLElements.Item Method
  • Programming Category: XML Programming


TXTextControl.XMLElements.Item Method

Returns a specific XML element of an XMLElements collection.

Syntax

   XMLElements.Item Index
Parameter | Description
Index | Specifies the position of the XML element in the collection. It must be a number from 1 to the value of the collection's Count property. If this value does not match any existing member of the collection, an error occurs.

Return Value

The method returns an XMLElement object.

Data Types

Index: | Long
Return value: | XMLElement Object

Example

The following Basic example displays the content of the second Address element in an XML document that contains addresses. Because the Item method is the default method of the XMLElements collection and the Text property is the default property of the XMLElement object the three lines of code are equivalent:

MsgBox TXTextControl1.XMLElements("Address").Item(2).Text

MsgBox TXTextControl1.XMLElements("Address")(2).Text

MsgBox TXTextControl1.XMLElements("Address")(2)

See Also

  • Working with XML Files
  • XMLElement Object
  • XMLElements Collection
  • Programming Category: XML Programming


TXTextControl.XMLElements.Remove Method

Removes an XML element from an XMLElements collection.

Syntax

   XMLElements.Remove Index
Parameter | Description
Index | Specifies the position of the XML element in the collection. It must be a number from 1 to the value of the collection's Count property. If this value does not match any existing member of the collection, an error occurs.

Return Value

Parameter | Description
0 | An error has occurred.
1 | The element could not be removed because the document becomes invalid according to the document's DTD. In this case Text Control fires an XMLInvalid event.
2 | The new element has been successfully removed.

Data Types

Index: | Long
Return value: | Integer

Example

The following Basic example removes the second Address element of an XML document that contains addresses:

TXTextControl1.XMLElements("Address").Remove(2)

See Also

  • Working with XML Files
  • XMElement Object
  • XMElement Collection
  • Programming Category: XML Programming


Obsolete Properties, Methods and Events

TXTextControl.EnableHyperlinks Property (Obsolete)

TXTextControl.RTFExport Method (Obsolete)

TXTextControl.RTFImport Method (Obsolete)

TXTextControl.TextExport Method (Obsolete)

TXTextControl.TextImport Method (Obsolete)

TXTextControl.ViewClicked Event (Obsolete)

TXTextControl.ViewImagePath Property (Obsolete)

TXTextControl.ViewNextHighlight Method (Obsolete)

TXTextControl.ViewSection Property (Obsolete)

TXTextControl.ViewWordDblClicked Event (Obsolete)

TXTextControl.VTSpellCheck Method (Obsolete)

TXTextControl.VTSpellDictionary Property (Obsolete)


TXTextControl.EnableHyperlinks Property (Obsolete)

This property must be set to True to enable special actions for pieces of text that function as hyperlinks. After loading a document that contains hyperlinks the user receives ViewClicked and ViewWordDblClicked events and can use the ViewSection and ViewNextHighlight properties and methods. With enabled hyperlinks a Text Control cannot be edited.

Syntax

   TXTextControl.EnableHyperlinks [= boolean]
Setting | Description
True | Hyperlinks are enabled. The Viewxx events and methods are available.
False | (Default) Hyperlinks are disabled. The Viewxx events and methods are not available.

Data Types

Boolean.

See Also

  • LoadSaveAttribute Property


TXTextControl.RTFExport Method (Obsolete)

Writes the contents of a Text Control to a file with the specified name using the Rich Text Format.

Syntax

   TXTextControl.RTFExport Filename

Return Value

The method returns True when the data has been written to the file. Otherwise it returns False.

Remarks

RTF (Rich Text Format) is one of the most common interchange formats for text documents. Most word processors available for Windows are able to read and write RTF files.

Data Types

FileName: | String
Return value: | Boolean

See Also

  • RTFImport Method


TXTextControl.RTFImport Method (Obsolete)

Loads the contents of an RTF file with the specified name into a Text Control.

Syntax

   TXTextControl.RTFImport Filename[, Extended]
Parameter | Description
Filename | Is the name of the RTF file that is to be loaded.
Extended | Optional. If this parameter is missing or zero then the text is inserted at the current caret position. If this parameter has a value of 1 then Text Control supports a special Viewer mode. In this mode, additional hypertext information is imported from the RTF file. See TX Info Artist manual for details.

Return Value

The method returns True when the data could be imported. Otherwise it returns False.

Remarks

RTF (Rich Text Format) is one of the most common interchange formats for text documents. Most word processors available for Windows are able to read and write RTF files.

Data Types

FileName: | String
Extended: | Long
Return value: | Boolean

See Also

  • RTFExport Method
  • ViewImagePath Property


TXTextControl.TextExport Method (Obsolete)

Writes the selected text to a file in ANSI format.

Syntax

   TXTextControl.TextExport FileName
Parameter | Description
FileName | Is the name of the file, Text Control uses for saving. When the file does not exist, a new file with this name is created. When the file exists, Text Control overwrites its current contents.

Return Value

The method returns True when the text has been written to the file. Otherwise it returns False.

Data Types

FileName: | String
Return value: | Boolean

See Also

  • TextImport Method
  • RTFImport Method
  • Save Method


TXTextControl.TextImport Method (Obsolete)

Loads text in ANSI format and inserts it at the current caret position.

Syntax

   TXTextControl.TextImport FileName
Parameter | Description
FileName | Is the name of the file, Text Control uses for loading.

Return Value

The method returns True when the text could be imported. Otherwise it returns False.

Data Types

FileName: | String
Return value&:nbsp; | Boolean

See Also

  • TextExport Method
  • RTFExport Method
  • Load Method


TXTextControl.ViewClicked Event (Obsolete)

Occurs when a marked text field for which hyperlink data has been stored, is clicked on. It occurs only if the EnableHyperlinks property is set to True.

Syntax

   ViewClicked(FieldType, FieldContents)
Parameter Description
FieldType

Specifies the type of a field as an identifier. It can be one of the following values:

Code | Meaning
0 - 19 | Specifies fields that represent links to text positions within the same document (RTF only).
20 - 39 | Specifies buttons that represent link positions (RTF only).
100 | Specifies a field that is a link to a position in the same document (HTML only).
101 | Specifies a field that is a link to an external position (HTML only).
FieldContents

Is a string that represents the contents of the field. The specification depends on the field's type and on the type of the document.

Remarks

This event is sent before a FieldClicked event is sent.

Data Types

FieldType: | Integer
FieldContents: | String

See Also

  • EnableHyperlinks Property


TXTextControl.ViewImagePath Property (Obsolete)

When importing text data files which contain references to image files, the ViewImagePath property can be used to specify a different path for the images.

Syntax

TXTextControl.ViewImagePath [= string]

Data Types

String.

Limitations

Run time only.

See Also

  • RTFImport Method


TXTextControl.ViewNextHighlight Method (Obsolete)

Scrolls to the next highlight.

Syntax

TXTextControl.ViewNextHighlight

Return Value

The method returns False if the last highlight has been reached. Otherwise it returns True.

Remarks

The use of this method is only valid if the RTFImport method was previously used with the Extended parameter set to 1. See TX Info Artist description for details.

Data Types

Return value: Boolean

See Also

  • RTFImport Method


TXTextControl.ViewSection Property (Obsolete)

Jumps to a specified text position. See TX Info Artist description for details.

Syntax

TXTextControl.ViewSection [= SectionNumber]

Remarks

The use of this property is only valid if the RTFImport method was used before with the Extended parameter set to 1.

Data Types

Integer.

Limitations

Write only, run time only.

See Also

  • RTFImport Method


TXTextControl.ViewWordDblClicked Event (Obsolete)

Occurs when a word is double-clicked with the mouse. It occurs only if the EnableHyperlinks property is set to True.

Syntax

   ViewWordDblClicked(SelectedText)
Parameter | Description
SelectedText | Is the word that has been double-clicked.

Remarks

This event is sent before a DblClick event is sent.

Data Types

SelectedText String

See Also

  • RTFImport Method
  • DblClick Event


TXTextControl.VTSpellCheck Method (Obsolete)

Starts the spellchecker. This method is only available if the VT Speller tool from VisualTools has been installed. VT Speller is not part of the Text Control package. Note that VT Speller is no longer available.

Syntax

   TXTextControl.VTSpellCheck

Return Value

The method returns True if the spellchecker could be started, otherwise it returns False.

Data Types

Return value: Boolean

See Also

  • VTSpellDictionary Property


TXTextControl.VTSpellDictionary Property (Obsolete)

Determines the file name of the dictionary which is used by VT-Speller. Text Control uses this property only if the VT-Speller tool from VisualTools has been installed. VT Speller is not part of the Text Control package. Note that VT Speller is no longer available.

Syntax

TXTextControl.VTSpellDictionary [= string]

Data Types

String.

See Also

  • VTSpellCheck Method