EirikO

I have a app for WM5.0 with a tab control (CTabCtrl).

How can I exchange data between the tabs (the different dialog boxes)

F.ex. in the first tab I have a edit-box and in the second I have a list box. How can I set add the text from the first tab to the list box in the second



Re: Smart Devices Native C++ Development Exchange data in tab control

Guang-Ming Bian - MSFT

hi EiriKO

There is mamy ways to solve your problem. I provide one of these.

You can create a variable in each tab, when you select the second tab, you can do:

Code Snippet

void CtestTabControlDlg::OnTcnSelchangeTab1(NMHDR *pNMHDR, LRESULT *pResult)

{

// TODO: Add your control notification handler code here

int CurSel;

CurSel=m_tabCtrl.GetCurSel();

switch(CurSel)

{

case 0:

m_page1.ShowWindow(true);

m_page2.ShowWindow(false);

break;

case 1:

m_page1.ShowWindow(false);

m_page2.ShowWindow(true);

// data transfer

m_page1.UpdateData();

m_page2.text = m_page1.text;

break;

default: ;

}

*pResult = 0;

}

When m_page2.text get the value, you can add the text variable to listbox.

I hope it helpful to you.