ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Highlight text in textboxes (https://www.excelbanter.com/excel-programming/349383-highlight-text-textboxes.html)

Frederick Chow

Highlight text in textboxes
 
Hi all,

A simple question: How can I programmatcially highlight text in a textbox?
Textbox.SetFocus doesn't work. Thanks for your advcie in advance.

Frederick Chow



Bob Phillips[_6_]

Highlight text in textboxes
 
With TextBox1
.SelStart = 1
.SelLength = Len(.Text)
.SetFocus
End With

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Frederick Chow" wrote in message
...
Hi all,

A simple question: How can I programmatcially highlight text in a textbox?
Textbox.SetFocus doesn't work. Thanks for your advcie in advance.

Frederick Chow





Frederick Chow

Thank you very much (N/C)
 

"Bob Phillips" wrote in message
...
With TextBox1
.SelStart = 1
.SelLength = Len(.Text)
.SetFocus
End With

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Frederick Chow" wrote in message
...
Hi all,

A simple question: How can I programmatcially highlight text in a
textbox?
Textbox.SetFocus doesn't work. Thanks for your advcie in advance.

Frederick Chow








All times are GMT +1. The time now is 05:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com