Thread: Text Boxes
View Single Post
Old Jun 3rd, 2005, 12:52 PM   #2
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
Surely you mean I-bar, not the mouse cursor?
It's position and length are controlled by the selstart and sellength properties. You could count the number of line feed characters up to that point to determine the current line, and then set the position the hard way but why not just:
Private Sub Text1_KeyDown(KeyCode as Integer, Shift as Integer)
If KeyCode = vbKeyLeft then KeyCode = vbKeyHome
End Sub
Rory is offline   Reply With Quote