Selection In A Textbox

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

How can I turn the selection highlight off when I enter a textbox? I tried
setting SelLength to 0 but it still selected 1 character. Can I change the color
of the selection highlight?

I want to turn the backcolor of a textbox to blue in the OnEnter event but the
selection highlight interferes with what I want to do.

Thanks!

Mark
 
Mark, I think there are two problems.
1. Tools|Options|Keyboard|Behavior Entering Field take option "Go to
Start"
This will stop the whole field being selected.
2. As for the background color when entering/leaving a field, do this:
OnGotFocus enter "=fcnHiLite()"
OnLostFocus enter "=fcnLoLite()"
3. Put these functions in a module:
(this is aircode, but probably good)

Function fcnHiLite()
On Error Resume Next
Dim ctlCurr As Control
Set ctlCurr = Screen.ActiveControl
ctlCurr.BackColor = 7534830 'yellow
End Function
Function fcnLoLite()
On Error Resume Next
Dim ctlCurr As Control
Set ctlCurr = Screen.ActiveControl
ctlCurr.BackColor = 16777215 'white
End Function

You can adjust the colors by changing the numbers..

HTH, UpRider
 
Back
Top