Click to See Complete Forum and Search --> : how can I create an edit box with : in the box


Danielle Harvey
April 15th, 1999, 12:37 PM
I have a dialog box with an edit box for time in the box. I can fix the length of the edit box to 5 characters, but how can I fix a semi-colon within the edit box so that the user can change the hour or the minutes, but she or he can't delete the semicolon. I saw this technique in a ms program where the user inputs the social security number as xxx-xx-xxxx and the user can't delete the dashes.

I appreciated any type of response, especially an an example as to how to implement this.

Masaaki
April 15th, 1999, 12:55 PM
Hi.

You have two options.
1) Use Masked Edit control(?) of ActiveX control.
2) Derived your own EditBox class and use OnChar().

Hope for help.
-Masaaki Onishi-

Fabian
April 15th, 1999, 01:27 PM
Hi, you should take a look to CodeGuru-Edit control section, there you'll find a lot of good example how to do it.

Fabian