Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textbox Cursor - Changing the guard

Status
Not open for further replies.

sodakotahusker

Programmer
Mar 15, 2001
601
I know you can change the mousepointer but what about the cursor in the textbox. I have an activex control for data input and I want to be able to toggle back and forth between insert and overtype mode. I use italics to indicate that overtype mode is on. However it is hard to read those dang boxes with italics. I would like to change the text cursor the way quick basic changed to a full character highlight in overtype mode (something noticeable but not distracting). Is there an API I can use to do this or something like it???
 
VBA has a property called MousePointer in its textbox. I haven't checked VB yet.

Dan
 
I went into Access to try this out and it might supply the look you need.

Input Masks accept data entry in Overtype mode.

The following command button event activates an input mask which allows any characters or spaces and sets the cursor to the beginning of the text box.


Private Sub Command12_Click()
With Text0
.InputMask = "CCCCCCCCC"
.SetFocus
.SelStart = 0
End With

End Sub

Hope it helps.
 
Well, I'm not very good at API, but what about SendKeys.

I just tested Access, and on placing the cursor in the textbox, then pressing the Insert key, it changed the cursor.

So, perhaps OnFocus Then SendKeys????

Dan
 
Access Textboxes do exactly what I want to do with the VB textbox. Why they work differently, I don't know. There must be some API to make them change this cursor.
 
Is this your own ActiveX control? What version of VB are we in?

Unfortunately I have found super features in VB5 and VB6 that are not in VBA5 and VBA6, and vice versa. Very frustrating.

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top