Alex5775
Alex5775

Reputation: 25

Visual C++ stop textbox cursor movement

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.

Upvotes: 0

Views: 79

Answers (1)

nate
nate

Reputation: 1871

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.

Upvotes: 0

Related Questions