Visual C++ stop textbox cursor movement

76 Views Asked by At

In visual c++ is there anyway to stop the user from using the arrow keys to move the cursor in a textbox? I've got a textbox for a phone number set up like "()-" and when you click or enter text it automatically re-positions the cursor to the next space to enter a number, but you can still use the arrow keys to re-position the cursor which lets you delete the parenthesis and dash.

1

There are 1 best solutions below

0
nate On

You could subclass it and prevent the arrow key events from reaching the edit box. How to accomplish this would depend on what framework (or lack thereof) you are using.