I have some radio buttons that decide the type of input to be given to the CEdit
control. By design, my CEdit control accepts numbers and characters.
Is there a way to limit this input to only numbers only when the user clicks on a provided radio button? Also, when the user clicks on the other option (i.e. alpha-numeric mode), is it possible to switch back?
I set up my CEdit
control to accept alpha-numeric characters using Visual C++'s GUI (i.e. right click on the control -> Properties -> "Styles" tab -> select "Number").
An example use case:
- User starts application.
- User clicks on some button and this dialog with the
CEdit
control in consideration shows. - User is presented with radio buttons where the alpha-numeric button is selected by default (since this is the default mode set at design time).
- User clicks on numeric.
At this point I want to restrict input to the CEdit
control to only numbers. Similarly, after this, if the user clicks on the alpha-numeric radio button again, I want to remove that restriction.