[Question] How to get Data from Edit Class
I Have two questions Regarding to Edit Class :
Q1: If I want to input only integer Number to Edit Class. how can I Prevent user to input characters to Edit Class
Q2 : How can I get data Input to Edit_Class
Simply my Application is to create Edit_Classes to Let user provide the application Numbers
Thanks & Regards
Re: [Question] How to get Data from Edit Class
Handle WM_CHAR message and check if the inputted character is a digit or not.
You should also handle the case of a negative numbers if they are allowed: it means that the "minus" is allowed only as the first symbol in the control.
Re: [Question] How to get Data from Edit Class
Quote:
Originally Posted by
mecheil.edwar
I Have two questions Regarding to Edit Class :
Q1: If I want to input only integer Number to Edit Class. how can I Prevent user to input characters to Edit Class
Q2 : How can I get data Input to Edit_Class
Simply my Application is to create Edit_Classes to Let user provide the application Numbers
Thanks & Regards
A1: ES_NUMBER
A2: GetDlgItemInt
Re: [Question] How to get Data from Edit Class
Only handling WM_CHAR is most likely not enough, you will also have to handle WM_PASTE.
Re: [Question] How to get Data from Edit Class
Thanks to all for their effective replies,
But still I have problem to get Real Number (as Example 23.334)
If I can get any sample Example It will be better to clear using concpet
My Best Regards to all
Re: [Question] How to get Data from Edit Class
Re: [Question] How to get Data from Edit Class
Thanks for VictorN , Igor and Marc for their answers ,
I have other question , If I add Edit Class inside Dialog Class ,
I found that WM_CHAR message is not working ,
How I can get WM_CHAR Message from Dialog class to control char from dialog Box
My Best Regards
Re: [Question] How to get Data from Edit Class