可以采用变通的方法,创建一个光标:'On form1 place 2 textboxes (with a height for a couple of lines) and 1 picturebox. 'Select a bitmap for the picturebox and set the autosize on true. 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 Declare Function GetFocus Lib "user32" () As Long Private Declare Function SetCaretPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long Private Declare Function SetCaretBlinkTime Lib "user32" (ByVal wMSeconds As Long) As LongPrivate Sub Text2_GotFocus() 'retrieve the window which has the focusEnd SubPrivate Sub Command1_Click() 'h& = GetFocus&() 'Create a new cursor Call CreateCaret(Me.hwnd, 0, 5, 5) SetCaretPos 30&, 30& 'Show the new cursor SetCaretBlinkTime 100 x& = ShowCaret&(h&) End Sub
do
doevnets
loop
'Select a bitmap for the picturebox and set the autosize on true.
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 Declare Function GetFocus Lib "user32" () As Long
Private Declare Function SetCaretPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Private Declare Function SetCaretBlinkTime Lib "user32" (ByVal wMSeconds As Long) As LongPrivate Sub Text2_GotFocus()
'retrieve the window which has the focusEnd SubPrivate Sub Command1_Click()
'h& = GetFocus&()
'Create a new cursor
Call CreateCaret(Me.hwnd, 0, 5, 5)
SetCaretPos 30&, 30&
'Show the new cursor
SetCaretBlinkTime 100
x& = ShowCaret&(h&)
End Sub
管理起来也挺很麻烦的。