'Put
This public declaration in module section Public Declare Function CreateCaret Lib "user32" (ByVal hwnd As Long, ByVal hBitmap As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long Public Declare Function ShowCaret Lib "user32" (ByVal hwnd As Long) As Long Public Declare Function GetFocus Lib "user32" () As Long 'Put a picture box on the form and select bitmap file. Set Autosize properties to true. 'Write down this code on the form Private Sub Text1_GotFocus() h& = GetFocus&() b& = Picture1.Picture t& = CreateCaret(h&, b&, 5, 5) x& = ShowCaret&(h&) End Sub |