| Skype: | TextControlSupport | |
| Orders: | 877-462-4772 |

| Author: | TX Text Control Support Department |
| Language: | Visual Basic .NET |
| Version: | 1.0 |
| Released: | March 16, 2005 |
| Last modified: | January 11, 2008 |
| Requirements: | TX Text Control .NET with Visual Basic .NET |
| Download code: | case_change.zip |

A desirable feature of a word processing application is to change the case of a word, sentence or entire document.
This .NET based sample application illustrates how to implement the different cases known from Microsoft Word.
We are going to implement the following case changes:
The implementation is really simple. We just loop through the selected text and replace the current character with its newly specified case. If the current character is to be converted to an upper case character, it is replaced using this simplified code:
selChar = TextControl1.Selection.Text If selChar.IsLetter(selChar) = True Then TextControl1.Selection.Text = selChar.ToUpper(selChar) End If
The Char namespace of .NET offers the functions toUpper and toLower that can be used to change the case of characters.
In the sample application, you will see how the other cases are implemented and which constraints need to be followed.
The minimum requirements for this sample application are TX Text Control .NET trial version and Visual Studio .NET 2003.