[Question] How to get Data from Edit Class
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: [Question] How to get Data from Edit Class

  1. #1
    Join Date
    Jun 2012
    Location
    UAE
    Posts
    59

    [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

  2. #2
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,006

    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.
    Victor Nijegorodov

  3. #3
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    5,877

    Re: [Question] How to get Data from Edit Class

    Quote Originally Posted by mecheil.edwar View Post
    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
    Best regards,
    Igor

  4. #4
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,060

    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.

  5. #5
    Join Date
    Jun 2012
    Location
    UAE
    Posts
    59

    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

  6. #6
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,060

    Re: [Question] How to get Data from Edit Class


  7. #7
    Join Date
    Jun 2012
    Location
    UAE
    Posts
    59

    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

  8. #8
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,006

    Re: [Question] How to get Data from Edit Class

    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center