|
|
Title | Color HTML tags in a RichTextBox |
Description | This example shows how to color HTML tags in a RichTextBox in Visual Basic 6. It searches the text for tags in brackets and colors them appropriately. It continuously rechecks the text using a timer so it can color tags as you type. |
Keywords | RichTextBox, Rich Text, RTF, HTML, color tags, tag |
Categories | Controls, Utilities |
|
|
Thanks to Yaron Budowski.
When a timer fires, the program searches the text for open brackets (<) and their corresponding close brackets (>). It colors various components of the HTML text in different ways. The timer makes the program recheck the code periodically so it colors tags as you type. It saves time by only recoloring the line you are typing on rather than the whole file.
See the code for the details.
|
|
|
|
|
|