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. List box Issue

List box Issue

Scheduled Pinned Locked Moved C / C++ / MFC
help
7 Posts 5 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.
  • I Offline
    I Offline
    itkid
    wrote on last edited by
    #1

    Hi Friends, I have one window on which I want to display SSN. SSN is one of the option in list and it value display infront of it in edit box. Can you pls help me to display these scenario. I am new to windows programming. Thanks :)

    H _ S U 4 Replies Last reply
    0
    • I itkid

      Hi Friends, I have one window on which I want to display SSN. SSN is one of the option in list and it value display infront of it in edit box. Can you pls help me to display these scenario. I am new to windows programming. Thanks :)

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      what do you need? show value from ListBox or show value in editbox for show text in editbox use m_Edit1.SetWindowText("text"); for read from listbox use m_List1.GetText(m_List1.GetCurSel(),str)_**


      **_

      whitesky


      1 Reply Last reply
      0
      • I itkid

        Hi Friends, I have one window on which I want to display SSN. SSN is one of the option in list and it value display infront of it in edit box. Can you pls help me to display these scenario. I am new to windows programming. Thanks :)

        _ Offline
        _ Offline
        _AnsHUMAN_
        wrote on last edited by
        #3

        Iterate through the items of the list box using the GetCount(). Create an array of the edit box's in front of the boxes. Dpeneding on the count of the list go on setting the corresponding values of the list box into the edit boxes. Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_

        I 1 Reply Last reply
        0
        • I itkid

          Hi Friends, I have one window on which I want to display SSN. SSN is one of the option in list and it value display infront of it in edit box. Can you pls help me to display these scenario. I am new to windows programming. Thanks :)

          S Offline
          S Offline
          Sarath C
          wrote on last edited by
          #4

          Pls be more specific. the last sentences are not clear. u can SetWindowText to set a window text. either u may have to create control varibles (string variable) for the controls u put in the the window or use GetDlgItem to get window handle. check MSDN for more info SaRath
          "D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"

          1 Reply Last reply
          0
          • _ _AnsHUMAN_

            Iterate through the items of the list box using the GetCount(). Create an array of the edit box's in front of the boxes. Dpeneding on the count of the list go on setting the corresponding values of the list box into the edit boxes. Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_

            I Offline
            I Offline
            itkid
            wrote on last edited by
            #5

            Thank you for help. I am looking for exactly same answer. Do i really need to travese all the list? Since we know when list show SSN,set the value in edit box.Is it possible to reach directly to index of SSN in the list and same for edit box? Thanks :)

            _ 1 Reply Last reply
            0
            • I itkid

              Thank you for help. I am looking for exactly same answer. Do i really need to travese all the list? Since we know when list show SSN,set the value in edit box.Is it possible to reach directly to index of SSN in the list and same for edit box? Thanks :)

              _ Offline
              _ Offline
              _AnsHUMAN_
              wrote on last edited by
              #6

              I didn't get what you need to do exactly? May be you want to have a look at the LBN_SELCHANGE event of the list box. Also list box is shown at the time of initdialog and so you can put some of your code over there. Does this solve your problem? Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_

              1 Reply Last reply
              0
              • I itkid

                Hi Friends, I have one window on which I want to display SSN. SSN is one of the option in list and it value display infront of it in edit box. Can you pls help me to display these scenario. I am new to windows programming. Thanks :)

                U Offline
                U Offline
                User 3037427
                wrote on last edited by
                #7

                U can make use of the function GetCurSel() to get the current selected item index. Now you can use GetText(index,string) to get the selected item text into the string. Set the retrieved string into the Edit box using SeWindowText().:)

                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