giannis said:
How can suppress (wipe off) the cursor of a field
in a form without set the propery "Enabled" to No ?
(I need this field enabled but without cursor)
Otherwise how can change the cursor colour ?
(I dont want to skip tabbing into the textbox i want
the cursor dont seen)
This seems an odd thing to want to do, but if you really want to, you
can call the Windows API to do it. I'm no API maven and can't guarantee
that the code sample below is free from errors, but it works in my quick
test:
'----- start of code from form module -----
Option Compare Database
Option Explicit
Private Declare Function apiShowCaret Lib "user32" _
Alias "ShowCaret" _
(ByVal hwnd As Long) _
As Long
Private Declare Function apiHideCaret Lib "user32" _
Alias "HideCaret" _
(ByVal hwnd As Long) _
As Long
Private Declare Function apiGetFocus Lib "user32" _
Alias "GetFocus" _
() As Long
Private Sub Text2_GotFocus()
Dim lngRet As Long
lngRet = apiHideCaret(apiGetFocus())
End Sub
Private Sub Text2_LostFocus()
Dim lngRet As Long
lngRet = apiShowCaret(apiGetFocus())
End Sub
'----- end of code from form module -----
The above code hides the caret when text box Text2 gets the focus and
shows it again when the focus leaves that control. You may well want to
move the API function declarations from the form module to a standard
module, in which case you'd also want to change them from Private to
Public.
Good luck!