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. copying textbox information

copying textbox information

Scheduled Pinned Locked Moved C / C++ / MFC
c++data-structureshelpquestion
10 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.
  • A Offline
    A Offline
    Adnan Merter
    wrote on last edited by
    #1

    i have a form having five different textboxes in vc++, and i need to copy all integer values from this textboxes to a 2d array. how can i do this. please help. thanks.

    M M 2 Replies Last reply
    0
    • A Adnan Merter

      i have a form having five different textboxes in vc++, and i need to copy all integer values from this textboxes to a 2d array. how can i do this. please help. thanks.

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      CWnd::GetWindowText() / WM_GETTEXT to get the text from the control Some version of strtol() to convert a string to an integer The assignment operator (=) to assign the integer to the array. Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      A 1 Reply Last reply
      0
      • M Mark Salsbery

        CWnd::GetWindowText() / WM_GETTEXT to get the text from the control Some version of strtol() to convert a string to an integer The assignment operator (=) to assign the integer to the array. Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        A Offline
        A Offline
        Adnan Merter
        wrote on last edited by
        #3

        sorry it isnt not clear enough. can you give me more getails. thanks

        M 1 Reply Last reply
        0
        • A Adnan Merter

          sorry it isnt not clear enough. can you give me more getails. thanks

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          Which part?  Getting text from controls?  Converting text to integer? Copying an integer to an integer array?  Are you using MFC or straight Win32 APIs? Mark

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          A 1 Reply Last reply
          0
          • M Mark Salsbery

            Which part?  Getting text from controls?  Converting text to integer? Copying an integer to an integer array?  Are you using MFC or straight Win32 APIs? Mark

            Mark Salsbery Microsoft MVP - Visual C++ :java:

            A Offline
            A Offline
            Adnan Merter
            wrote on last edited by
            #5

            i know how i can convert to integer. i use "Convert::Toint32" and i alsoo know how i can copy an integer to an array. iwould like to know getting text from controls. i am trying to create windows form application

            M 1 Reply Last reply
            0
            • A Adnan Merter

              i have a form having five different textboxes in vc++, and i need to copy all integer values from this textboxes to a 2d array. how can i do this. please help. thanks.

              M Offline
              M Offline
              Michael Schubert
              wrote on last edited by
              #6

              What do you mean by "textbox"? Is it a static control, edit control, listbox control?

              A 1 Reply Last reply
              0
              • M Michael Schubert

                What do you mean by "textbox"? Is it a static control, edit control, listbox control?

                A Offline
                A Offline
                Adnan Merter
                wrote on last edited by
                #7

                i meant a listbox

                M 1 Reply Last reply
                0
                • A Adnan Merter

                  i meant a listbox

                  M Offline
                  M Offline
                  Michael Schubert
                  wrote on last edited by
                  #8

                  Are you using MFC?

                  A 1 Reply Last reply
                  0
                  • M Michael Schubert

                    Are you using MFC?

                    A Offline
                    A Offline
                    Adnan Merter
                    wrote on last edited by
                    #9

                    no i am using CLR

                    1 Reply Last reply
                    0
                    • A Adnan Merter

                      i know how i can convert to integer. i use "Convert::Toint32" and i alsoo know how i can copy an integer to an array. iwould like to know getting text from controls. i am trying to create windows form application

                      M Offline
                      M Offline
                      Mark Salsbery
                      wrote on last edited by
                      #10

                      Ohhh it's a managed c++ app.  You're in the wrong forum to start with. The TextBox class has a property called Text.  If you have a TextBox object for the edit control, you can get its text with this property:

                      System::Windows::Forms::TextBox ^MyTextBox = ...;
                      ...
                      int MyInt = Convert::ToInt32(MyTextBox->Text);

                      Mark *edit* fixed wrong operator


                      Last modified: 11mins after originally posted --

                      Mark Salsbery Microsoft MVP - Visual C++ :java:

                      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