'nécessite une TextBox et une PictureBox
'capture visible ici : http://img99.imageshack.us/img99/9449/sanstitre2yn6.jpg
'
Option Explicit
Private Declare Function CreateCaret Lib "user32" (ByVal hwnd As Long, ByVal hBitmap As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function ShowCaret Lib "user32" (ByVal hwnd As Long) As Long
'
'
'**********************
'
'
Private Sub Form_Load()
' créé l'image
With Picture1
.Width = 135
.Height = 255
.Picture = .Image
.Visible = False
End With
End Sub
Sub Text1_GotFocus()
Dim h As Long, p As Long
h& = Text1.hwnd
p& = Picture1.Picture
CreateCaret h&, p&, 0, 0
ShowCaret h&
End Sub
'
'
'**********************
'
' VOUS POUVEZ PASSER PAR UN OBJET STDPICTURE POUR éVITER LA PICTUREBOX :
'
'
Dim O As New StdPicture
Private Sub Form_Load()
Set O = LoadPicture("C:\c.jpg")
End Sub
Sub Text1_GotFocus()
CreateCaret Text1.hwnd, O.Handle, 0, 0
ShowCaret Text1.hwnd
End Sub