Adding static text to combo box?
-
I am trying to add a combo box inside a DB that is editable and yet has strings that are commonly used. I have added the code to the HelloDlg.cpp code.
BOOL CHelloDlg::OnInitDialog() { CDialog::OnInitDialog(); m_operation.Insert (0,(_T("digging"))); m_operation.Insert (1,(_T("seed bed prep"))); m_operation.Insert (2,(_T("planting"))); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
And it will not add it to the m_operation combobox. Any ideas? Thanks alot Rod -
I am trying to add a combo box inside a DB that is editable and yet has strings that are commonly used. I have added the code to the HelloDlg.cpp code.
BOOL CHelloDlg::OnInitDialog() { CDialog::OnInitDialog(); m_operation.Insert (0,(_T("digging"))); m_operation.Insert (1,(_T("seed bed prep"))); m_operation.Insert (2,(_T("planting"))); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
And it will not add it to the m_operation combobox. Any ideas? Thanks alot RodThe following code works fine in my Pocket PC 2002 application:
...
// Dialog Data
//{{AFX_DATA(CPropConnectionPage)
enum { IDD = IDD_PAGE_PROPCONNECTION };
CComboBox m_cbxComPortNr;
//}}AFX_DATA
......
m_cbxComPortNr.ResetContent();for (int n = 1; n <= 255; n++)
{
CString str;
str.Format(_T("COM%d"), n);
m_cbxComPortNr.AddString(str);
}m_cbxComPortNr.SetCurSel(m_uiConnectionPort - 1);
...Regards, Daniel. -- FIND A JOB YOU LOVE, AND YOU'LL NEVER HAVE TO WORK A DAY OF YOUR LIFE. ;)