CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    10

    What's the best to read values form a CEdit control?

    In my application I need to read values (int, float) from a CEdit control. After that, when a press a button, calculations are made with these values and the result is to be shown in a CStatic control. What'sthe best way to do that?
    Also, when I change the values and press the button again (so that calculations are re-made), what kind of functions (and where do I put them) do I need to update data?
    Thanks.


  2. #2
    Join Date
    May 1999
    Location
    Oregon, USA
    Posts
    302

    Re: What's the best to read values form a CEdit control?

    UpdateData can get data in and out of a dialog.
    TN026 describes the various types of data supported
    and how write custom DDX functions. Write a handler
    for your button, have it call UpdateData(TRUE), then call
    your calculate function, and then call UpdateData(FALSE)
    and the data in the dialog will be updated. This assumes
    that there is DDX mapping for all data displayed.

    On this site there is an article called a SmartEdit control
    in the edit controls section that can help insure valid
    numeric entry. You can also use sliders with the data.
    I have used those classes and they were very helpful.




Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured