Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to show a value in an Edit Textbox

How to show a value in an Edit Textbox

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestiontutoriallearning
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    J_E_D_I
    wrote on last edited by
    #1

    Hi guys, I've written an application in pure C++ and the command line and now I'd like to convert it to Windows. I am at the very first steps in using MFC and I am wondering if anyone could be kind enough to help. To simplify the problem, let's suppose my application is composed of 2 input edit text boxes (Box1, Box2), a button (Calculate), and 1 output textbox (Box3). What is the correct code required to display the result of the calculation (Box1+Box2) in the output textbox (Box3)? I've read 1300 pages of the excellent Ivor Horton's Beginning C++ 2008 book....only to discover that this simple topic is not covered!! Many thanks jEDI

    D CPalliniC 2 Replies Last reply
    0
    • J J_E_D_I

      Hi guys, I've written an application in pure C++ and the command line and now I'd like to convert it to Windows. I am at the very first steps in using MFC and I am wondering if anyone could be kind enough to help. To simplify the problem, let's suppose my application is composed of 2 input edit text boxes (Box1, Box2), a button (Calculate), and 1 output textbox (Box3). What is the correct code required to display the result of the calculation (Box1+Box2) in the output textbox (Box3)? I've read 1300 pages of the excellent Ivor Horton's Beginning C++ 2008 book....only to discover that this simple topic is not covered!! Many thanks jEDI

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      J_E_D_I wrote:

      What is the correct code required to display the result of the calculation (Box1+Box2) in the output textbox (Box3)?

      Call SetWindowText(), or send the control a WM_SETTEXT message.

      "Love people and use things, not love things and use people." - Unknown

      "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

      J 1 Reply Last reply
      0
      • J J_E_D_I

        Hi guys, I've written an application in pure C++ and the command line and now I'd like to convert it to Windows. I am at the very first steps in using MFC and I am wondering if anyone could be kind enough to help. To simplify the problem, let's suppose my application is composed of 2 input edit text boxes (Box1, Box2), a button (Calculate), and 1 output textbox (Box3). What is the correct code required to display the result of the calculation (Box1+Box2) in the output textbox (Box3)? I've read 1300 pages of the excellent Ivor Horton's Beginning C++ 2008 book....only to discover that this simple topic is not covered!! Many thanks jEDI

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #3

        in MFC you may also map the three textboxes to three integer variables and use the UpdateData mechanism see [^]. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        In testa che avete, signor di Ceprano?

        1 Reply Last reply
        0
        • D David Crow

          J_E_D_I wrote:

          What is the correct code required to display the result of the calculation (Box1+Box2) in the output textbox (Box3)?

          Call SetWindowText(), or send the control a WM_SETTEXT message.

          "Love people and use things, not love things and use people." - Unknown

          "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

          J Offline
          J Offline
          J_E_D_I
          wrote on last edited by
          #4

          Thanks to both of you. I'll try it soon and let you know. jEDI

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups