Skype:TextControlSupport
Orders:877-462-4772
TX Text Control - word processing components.

UK Magazine PC Plus Review

After you've created your first 'Hello World' application in a new language (let's call it My Barely Understood Language), your next task will often be some kind of Notepad - a simple, bare bones text editor. There's a good reason so many 'First Steps in MyBUL'-type books pick on the text editor for an early tutorial. Following along will teach you how to open a text file, read it, display it on screen and save it again. If you persist you might add some search-and-replace functions, and pick up the rudimentaries of string manipulation.

All extremely valuable. However, although the BULPad may roost proudly in your system tray for days, few of us will go on to write Word 2001 with our new skills. Yet, every so often you need some real word processing power in a current project surfaces - whether it's just to add some bold to contact notes or for a wholesale merge of P45s with a personnel package.

Tempting though the thought of re-jigging the old BULPad may be, don't. TX Text Control is there to save you the trouble, gracefully handling tasks such as formatting, printing, tables, forms, mail merge, OLE objects like images, flowing text between text boxes, common file formats such as RTF and HTML and as a bound control linking to existing databases.

Both 32-bit OCX and DLLs are included with TX Text Control 5.01, so you can build them into a wide range of environments, ranging from Delphi to Access. If you are using a language which doesn't support ActiveX, have a look in the SAMPLES\DLL\SCRDEMO folder after installing for examples (in C) of using TX Text without the OCX wrapper. Most of the examples are in Visual Basic, however. They cover far more ground than we have room for here.

So for this quick introduction, we will simply take one of them (a very nice BULPad) and add a few lines of code so our users can save in Rich Text Format, readable by many word processors.

By default, all the samples are installed to the C:\Program Files\Common\DBS\TX\SAMPLES folder. We encountered a few problems with the samples in Visual Basic 6, but these are easily overcome by specifying a few missing properties. See note #1

Start by opening the reassuringly titled Simple.vbp in Visual Basic and playing around.

Try running the project. You will see that you can specify any print font and size available to your system, center, justify, bold and tab. You can do almost anything you could want in a simple text editor. Unfortunately, you can only save in TX Text Control's own format. But adding the option to save in Rich Text Format is easy.

View the code for Form1, and find the mnuFile SaveAs Click Sub. Currently the only choice the CommonDialog gives the user for saving is "TX Demo (*.tx)". Edit the CommonDialog.Filter line to read:

Next, add some code to handle the new extension. We could easily just tack this on the end of the mnuFile_SaveAs_Click sub, but we will be a little more thorough and separate it out into its own subroutine to make future additions (such as plain text or HTML) easier. Scroll to the bottom of the code window and create a SaveFile sub that takes Filename as a parameter.

The SaveFile subroutine will parse the filename to discover the format to save In. For the default format, TX's native .tx, it will save as before, If Rich Text Format is specified, it will gather attributes like the margins and page size from the text control. You never have to dirty your hands with the actual details of the file format. SaveFile should look something like this:

Finally, go back to mnuFile_SaveAs_. Click and make it call your new SaveFile sub by replacing the "TXTextControl1.Save CommonDialog1.Filename,0" line with:

Now give it a try. Make a file with some tortuous formatting, save it as RTF and then open it with your favorite word processor. It's almost too easy. Of course, if you wanted to be serious, you should probably put SaveFile in a module so you can easily reuse it. Adding other formats, such as TXT and HTML, is just as easy. Take a look at the MDI sample to see a full-blown word processor in action.

But that's only the beginning of TX Text Control. Tables can contain virtually any formatting that normal text can, and linked together enable you to build columned pages. You can embed other objects within a document and reposition text fields around the screen, making filling out and printing existing forms simple. Its real power comes into play once you start binding it to other data sources, enabling you to save formatted text into a database. There's even an Web browser built with TX Text Control in the samples. You'll never need your old BULPad again...

Notes from The Imaging Source

1. Please note that this review refers to version 5.01 of TX Text Control. The difficulties mentioned here were resolved in version 6 and are thus non-issues in the current version.

Matt Kynaston

External verification page for ISO 9000:2000 certificate
ISO 9001:2000
certified