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

tab control

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

    hi experts my problem is something like this.. i have a main dialogue in which i have a list control, and in the main dialogue i also have tab control. on the tabpane i have a list control again. now my job is when i click on an item in the list control of my main dialogue and press ADD button on the main dialogue, that item should be added to the list control in tabpane, but this is not happening. please help me. note: instead of having ADD button in the main dialogue , if i have it in tabpane itself the above problem is not there. and i am able to add the item from list control of main dialog to list contrtol of tab pane but i cannot have ADD button in tabpane Harsha

    R N 2 Replies Last reply
    0
    • H harsh_2961

      hi experts my problem is something like this.. i have a main dialogue in which i have a list control, and in the main dialogue i also have tab control. on the tabpane i have a list control again. now my job is when i click on an item in the list control of my main dialogue and press ADD button on the main dialogue, that item should be added to the list control in tabpane, but this is not happening. please help me. note: instead of having ADD button in the main dialogue , if i have it in tabpane itself the above problem is not there. and i am able to add the item from list control of main dialog to list contrtol of tab pane but i cannot have ADD button in tabpane Harsha

      R Offline
      R Offline
      Rage
      wrote on last edited by
      #2

      Can you post following code : - Event handler when you click on the button - Adding the string to the list in the tab control

      Company policy : no access to the internet but CP ~RaGE()

      H 1 Reply Last reply
      0
      • H harsh_2961

        hi experts my problem is something like this.. i have a main dialogue in which i have a list control, and in the main dialogue i also have tab control. on the tabpane i have a list control again. now my job is when i click on an item in the list control of my main dialogue and press ADD button on the main dialogue, that item should be added to the list control in tabpane, but this is not happening. please help me. note: instead of having ADD button in the main dialogue , if i have it in tabpane itself the above problem is not there. and i am able to add the item from list control of main dialog to list contrtol of tab pane but i cannot have ADD button in tabpane Harsha

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

        can you show the code inside the button click of Add.

        nave

        H 1 Reply Last reply
        0
        • R Rage

          Can you post following code : - Event handler when you click on the button - Adding the string to the list in the tab control

          Company policy : no access to the internet but CP ~RaGE()

          H Offline
          H Offline
          harsh_2961
          wrote on last edited by
          #4

          This below event handler belongs to ADD button of main dialogue void CNewUiDlg::OnBnClickedAdd() { CPhoneBook m_ph(this); CString val; int mark=m_mainlist.GetSelectionMark(); m_checken=m_mainlist.GetItemText(mark,0); //m_ph.AddtoPB(m_checken); } This below function belongs to class that is controling tab pane BOOL CPhoneBook::AddtoPB(CString s) { m_phoneval=s; m_listphone.InsertItem(0,m_phoneval); m_listphone.SetItemText(0,1,m_address); UpdateData(false); //MessageBox(m_phoneval); the message box displays the string } Instead if we add an ADD button to the tabpane itself and add the handler as below it works and displays the contents from list control of main dialogue to list control of tabpane void CPhoneBook::OnBnClickedAdd() { m_listphone.InsertItem(0,m_checken); m_listphone.SetItemText(0,1,m_address); } Harsha

          1 Reply Last reply
          0
          • N Naveen

            can you show the code inside the button click of Add.

            nave

            H Offline
            H Offline
            harsh_2961
            wrote on last edited by
            #5

            This below event handler belongs to ADD button of main dialogue void CNewUiDlg::OnBnClickedAdd() { CPhoneBook m_ph(this); CString val; int mark=m_mainlist.GetSelectionMark(); m_checken=m_mainlist.GetItemText(mark,0); //m_ph.AddtoPB(m_checken); } This below function belongs to class that is controling tab pane BOOL CPhoneBook::AddtoPB(CString s) { m_phoneval=s; m_listphone.InsertItem(0,m_phoneval); m_listphone.SetItemText(0,1,m_address); UpdateData(false); //MessageBox(m_phoneval); the message box displays the string } Instead if we add an ADD button to the tabpane itself and add the handler as below it works and displays the contents from list control of main dialogue to list control of tabpane void CPhoneBook::OnBnClickedAdd() { m_listphone.InsertItem(0,m_checken); m_listphone.SetItemText(0,1,m_address); } Harsha

            N 1 Reply Last reply
            0
            • H harsh_2961

              This below event handler belongs to ADD button of main dialogue void CNewUiDlg::OnBnClickedAdd() { CPhoneBook m_ph(this); CString val; int mark=m_mainlist.GetSelectionMark(); m_checken=m_mainlist.GetItemText(mark,0); //m_ph.AddtoPB(m_checken); } This below function belongs to class that is controling tab pane BOOL CPhoneBook::AddtoPB(CString s) { m_phoneval=s; m_listphone.InsertItem(0,m_phoneval); m_listphone.SetItemText(0,1,m_address); UpdateData(false); //MessageBox(m_phoneval); the message box displays the string } Instead if we add an ADD button to the tabpane itself and add the handler as below it works and displays the contents from list control of main dialogue to list control of tabpane void CPhoneBook::OnBnClickedAdd() { m_listphone.InsertItem(0,m_checken); m_listphone.SetItemText(0,1,m_address); } Harsha

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

              harsh_2961 wrote:

              int mark=m_mainlist.GetSelectionMark();

              you should not use GetSelectionMark() to get the selected item. Use GetNextItem instead. Also give show selection always style to list control and check. Let me know the result after this modification.

              nave

              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