I want to creat edit boxes once the user clicks on a button. The number created will depend on some other parameters. I can create the edit boxes but I can't add functionality tothem at the same time.
If I had an existing edit box, say Edit1, this is what I'd like it to do:
Code:
void CInitialGUIDlg::OnSetfocusEdit1()
{
// TODO: Add your control notification handler code here
CString str;
CListBox* pGetList = (CListBox*) GetDlgItem(IDC_LIST1);
pGetList->GetText((pGetList->GetCurSel()),str);
m_Edit1 = str;
UpdateData(false);
}
But now I want to add that functionality to this edit box once it's dynamically created.
Code:
void CInitialGUIDlg::OnButton2()
{
// TODO: Add your control notification handler code here
CEdit* pEdit = new CEdit;
pEdit->Create(ES_MULTILINE | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER,
CRect(325, 100,400, 125), this, 1);
/*
CString str;
CListBox* pGetList = (CListBox*) GetDlgItem(IDC_LIST1);
pGetList->GetText((pGetList->GetCurSel()),str);
m_Edit1 = str;
UpdateData(false);
*/
}
Is there a way to do it.