'Change Case' in TX Text Control ActiveX
This sample application implements Word-style case conversion in TX Text Control ActiveX using Visual Basic. It covers five modes: UPPER CASE, lower case, Title Case, tOgGlE cAsE, and Sentence case, relying on the built-in LCase and UCase functions for character transformations.

A desirable feature of a word processing application is to change the case of a word, sentence or entire document.
This sample application shows you how to implement the different cases known from Microsoft Word using TX Text Control ActiveX.
We are going to implement the following case changes:
- UPPER CASE (convert all characters to uppercase)
- lower case (convert all characters to lowercase)
- Title Case (first letter of each word is made uppercase)
- tOgGlE cAsE (toggle the text, whereby capital letters are made lowercase and lowercase letters are made uppercase)
- Sentence case. (convert the text, whereby the first character of the sentence is uppercase)
In Visual Basic, the functions
LCaseand
UCaseoffer the functionality to change the case of characters.
Please take a look at this sample application (complete with downloadable source code), to see how easily this 'change case' feature can be implemented in TX Text Control.
ActiveX
TX Text Control ActiveX is a royalty-free, fully programmable rich edit control that offers developers a broad range of word processing features in a reusable component. It provides comprehensive text formatting, powerful mail merge features and all word processing key concepts such as table support, images, headers and footers and page sections.
Related Posts
How to Get the Last Line in TX Text Control ActiveX
Detecting whether the cursor sits on the last line in TX Text Control ActiveX requires checking SelStart against both the full text length and the result of GetLineFromChar against GetLineCount.…
FontItalic on CTRL+i with TX Text Control ActiveX
By default, TX Text Control ActiveX inserts a tab character when the user presses CTRL+I because both share KeyAscii value 9. This VB sample tracks the CTRL key state in KeyDown, nullifies the tab…
Modifying Styles in TX Text Control ActiveX
TX Text Control .NET for Windows Forms exposes FormattingStyle as the base class for InlineStyle and ParagraphStyle. In the ActiveX edition, the Style object and Styles collection let developers…
Open Documents with an Offset
TX Text Control ActiveX supports saving documents with a byte offset to embed custom file headers. In TX Text Control .NET for Windows Forms, a FileStream with its Position property set to the…
Indents and Numbered Lists
The TX Text Control ActiveX button bar inserts numbered lists with different indentation than the ListType property alone. This code sample reproduces the exact button bar formatting by combining…
