devxlogo

Highlighting Text

Highlighting Text

Question:
Is there an API function that will highlight a word in a textbox the way the find command does without using the clipboard?

Answer:
Set the SelStart property of the text box = character index you want to start at, and then set the SelLength property equal to the length of the string you want to highlight. That will highlight the text that is in the box.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist