TX Text Control Source Code Library

Find and Replace Dialog - Part I

Find and replace is one of the most commonly used features in word processing applications. This sample shows how to implement a sophisticated MS Word-like find and replace dialog box.

This is the first of 2 articles that shows how to implement the 'Find' part of this feature.

The sample dialog box enables users to search for a specific string inside the currently attached TX Text Control instance. It is possible to search for words only, to enable match case and to use regular expression wild cards. Additionally, it is possible to specify a certain text format.

The find method matches the settings and the specified format. For example:

You can search for the string "Hello" formatted as bold. The dialog will return all instances that are formatted as bold.

The next part will show the 'Replace' part of this dialog.

To use the downloadable version of this sample TX Text Control .NET 14.0 trial version is required as a minimum.