You can use the CreateCaret and ShowCaret Win32 API functions. This example creates a cursor in a PictureBox (you would normally always do the call in the GotFocus event).Code:Private Declare Function CreateCaret Lib "user32.dll" ( _ ByVal hWnd As IntPtr, _ ByVal hBitmap As IntPtr, _ ByVal nWidth As Integer, _ ByVal nHeight As Integer _ ) As Boolean Private Declare Function ShowCaret Lib "user32.dll" ( _ ByVal hWnd As IntPtr _ ) As Integer Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load CreateCaret(PictureBox1.Handle, IntPtr.Zero, 0, 12) ShowCaret(PictureBox1.Handle) End Sub




Reply With Quote