ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Set Focus (https://www.excelbanter.com/excel-programming/293630-set-focus.html)

gregork

Set Focus
 
Hi,
I use set focus on a user form to move the cursor to text boxes after
certain events. What I want is instead of a cursor is to have the text box
"highlighted" so that I don't have to delete the existing value before
typing in a new value. I'm not sure what to call this format or if there is
a method/property for it in VB . It's like when you drag the cursor over
text and the background goes black ready for editing - this is the state I
want my textbox to be in after an event. How do I do this?

Regards
gregork



Vasant Nanavati

Set Focus
 
With TextBox1
.SelStart = 0
.SelLength = Len(.Text)
End With

--

Vasant

"gregork" wrote in message
...
Hi,
I use set focus on a user form to move the cursor to text boxes after
certain events. What I want is instead of a cursor is to have the text box
"highlighted" so that I don't have to delete the existing value before
typing in a new value. I'm not sure what to call this format or if there

is
a method/property for it in VB . It's like when you drag the cursor over
text and the background goes black ready for editing - this is the state I
want my textbox to be in after an event. How do I do this?

Regards
gregork





gregork

Set Focus
 
Thanks Vasant that was exactly what I was looking for.

Regards
gregork

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
With TextBox1
.SelStart = 0
.SelLength = Len(.Text)
End With

--

Vasant

"gregork" wrote in message
...
Hi,
I use set focus on a user form to move the cursor to text boxes after
certain events. What I want is instead of a cursor is to have the text

box
"highlighted" so that I don't have to delete the existing value before
typing in a new value. I'm not sure what to call this format or if there

is
a method/property for it in VB . It's like when you drag the cursor over
text and the background goes black ready for editing - this is the state

I
want my textbox to be in after an event. How do I do this?

Regards
gregork








All times are GMT +1. The time now is 11:55 AM.

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