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. Listbox control

Listbox control

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
6 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.
  • Z Offline
    Z Offline
    zareee
    wrote on last edited by
    #1

    hi, i have a editbox control in a dialog box. on entering the string in the editbox and clicking the button the string have to be inserted in the listbox of the already opened other dialog box can anybody help?? thanx in advance,

    zari

    N R _ 3 Replies Last reply
    0
    • Z zareee

      hi, i have a editbox control in a dialog box. on entering the string in the editbox and clicking the button the string have to be inserted in the listbox of the already opened other dialog box can anybody help?? thanx in advance,

      zari

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      keep a pointer of the list box in the first dialog( dialog which have the edit box). Then on pressing the button call the AddString function of that pointer.

      nave

      1 Reply Last reply
      0
      • Z zareee

        hi, i have a editbox control in a dialog box. on entering the string in the editbox and clicking the button the string have to be inserted in the listbox of the already opened other dialog box can anybody help?? thanx in advance,

        zari

        R Offline
        R Offline
        Rinu_Raj
        wrote on last edited by
        #3

        You may right the interface function for setting the value in the second dialog On the button click of first dialog { Dlg->SetDataToListBox( m_Edit.GetWindowText()); //Where Dlg is the second dialog class object } In the second dialog 2ndDlg::SetDataToListBox( CString EditData ) // SetDataToListBox function the dialog class of the second dialog { m_ListBox.AddString( EditData ); } Rinu Raj

        1 Reply Last reply
        0
        • Z zareee

          hi, i have a editbox control in a dialog box. on entering the string in the editbox and clicking the button the string have to be inserted in the listbox of the already opened other dialog box can anybody help?? thanx in advance,

          zari

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

          zareee wrote:

          : Re: Listbox control

          You can take the text of the edti box on the click of the button using the GetWindowText. For list control you can then use CListCtrl::SetItemText()which Changes the text of a list view item or subitem. BOOL SetItemText( int nItem, int nSubItem, LPCTSTR lpszText );

          zareee wrote:

          string have to be inserted in the listbox

          For List box you can use CListBox::InsertString() / CListBox::AddString()

          Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

          H 1 Reply Last reply
          0
          • _ _AnsHUMAN_

            zareee wrote:

            : Re: Listbox control

            You can take the text of the edti box on the click of the button using the GetWindowText. For list control you can then use CListCtrl::SetItemText()which Changes the text of a list view item or subitem. BOOL SetItemText( int nItem, int nSubItem, LPCTSTR lpszText );

            zareee wrote:

            string have to be inserted in the listbox

            For List box you can use CListBox::InsertString() / CListBox::AddString()

            Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

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

            I guess zareee can insert text to listbox,right?:)


            WhiteSky


            _ 1 Reply Last reply
            0
            • H Hamid Taebi

              I guess zareee can insert text to listbox,right?:)


              WhiteSky


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

              :zzz: Yes...

              Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

              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