CREATE YOUR OWN CARET WITH CUSTOM DESIGN TO SHOW IN THE TEXT-BOXES FOR YOUR APPLICATION
CREATE YOUR OWN CARET WITH CUSTOM DESIGN TO SHOW IN THE TEXT-BOXES FOR YOUR APPLICATION
API Declarations
Public Declare Function CreateCaret Lib "user32.dll" (ByVal hwnd As Long, ByVal hBitmap As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
'Displays the caret
Public Declare Function ShowCaret Lib "user32.dll" (ByVal hwnd As Long) As Long
'Destroys the caret
Public Declare Function DestroyCaret Lib "user32.dll" () As Long
Rate CREATE YOUR OWN CARET WITH CUSTOM DESIGN TO SHOW IN THE TEXT-BOXES FOR YOUR APPLICATION
(2(2 Vote))
' TextBox - Text1
' CommandButton - Command1
Private Sub Command1_Click()
Dim lRet As Long
'We set focus to let 'DestoryCaret' know about which caret to destory
Text1.SetFocus
Call DestroyCaret 'Destroys the old caret
'Creates a new caret for Text1 with size 8*12
'The argument 0& is for settings a picture as a caret.
'For settings picture in caret, load it in variable and then
'pass it in argument.
lRet = CreateCaret(Text1.hwnd, 0&, 8&, 12&)
'Just to know the return value
Caption = lRet
'Without 'ShowCaret' the new caret is not displayed, so use it now
Call ShowCaret(Text1.hwnd)
End Sub
'Errors, feedbacks, etc...
'MAIL: [email protected]
CREATE YOUR OWN CARET WITH CUSTOM DESIGN TO SHOW IN THE TEXT-BOXES FOR YOUR APPLICATION Comments
No comments yet — be the first to post one!
Post a Comment