Page 1 of 1

Restrict the user to enter only digits in the Edit box

Posted: Wed Jun 04, 2008 6:09 am
by serk
Hello,
I have a dialog in my installation where the user enters some values. These values are allowed to contain only digits. If I use normal edit boxes the user can also enter non-digit characters. There is a suggestion in the forum that masked edit can be used. This is a solution but in that case the user can click on a position in the masked edit and enter a value with spaces before the beginning. And it doesnt look good. Is there another way to force the user to enter only digits.

Thanks a lot,
Serhan

Posted: Wed Jun 04, 2008 6:42 pm
by Alex_Ronquillo
Serk,

I am sorry to tell you that there is no other way to do this. Mask edit would have to be the way to go for it.

Posted: Thu Jun 05, 2008 3:32 am
by serk
Hi Alex,
Thanks for the answer. The tool is really great. But i faced the following problems.

1) The problem with the masked edit is that normally when you click somewhere on a windows control like edit box or a masked edit the cursor position goes automatically the beginning of the edit box. In installaware, in the masked edit one can click on the middle of the box and
enter a value with spaces before and after the value. The cursor does not go automatically to the beginning. This is a very small problem, but prevents us from buying installaware and deploying our installation with installaware. Is there a way to correct this.

2) Call Dll Function works correct on my development machine. But on a clean operating system (only XP SP) it doesnt work correctly. What can be the reason for that? The relevant entries in the forum was not helpful.

Thanks a lot in advance,
Serhan