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. Mobile Development
  3. Mobile
  4. Adding static text to combo box?

Adding static text to combo box?

Scheduled Pinned Locked Moved Mobile
c++databasequestion
2 Posts 2 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.
  • R Offline
    R Offline
    rodneyk1
    wrote on last edited by
    #1

    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

    D 1 Reply Last reply
    0
    • R rodneyk1

      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

      D Offline
      D Offline
      Daniel Strigl
      wrote on last edited by
      #2

      The 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. ;)

      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