Thread: Combo Box ::MFC

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    77

    Combo Box ::MFC

    How to i insert item into the combo box using coding
    im using MFC dialog

  2. #2
    Unregistered
    Guest

    Cool

    One of the way is to use GetDlgItem with combobox resource id & cast it to CComboBox MFC class & then use AddString member to add an item.

    CComboBox p_cbox = (CComboBox*) GetDlgItem(/* combobox rc id */);

    p_cbox->AddString("Item1");

    OR u can use DDX mechanism..

    OR u can use subclassing

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Create new combo boxes based on items selected in preview combo box
    By RealityFusion in forum Windows Programming
    Replies: 2
    Last Post: 01-10-2007, 09:50 AM
  2. No data showing in combo box
    By PJYelton in forum Windows Programming
    Replies: 6
    Last Post: 04-29-2005, 07:20 PM
  3. How to program a "back" button with MFC
    By 99atlantic in forum Windows Programming
    Replies: 3
    Last Post: 04-26-2005, 08:34 PM
  4. New Theme
    By XSquared in forum A Brief History of Cprogramming.com
    Replies: 160
    Last Post: 04-01-2004, 08:00 PM
  5. Combo Box in MFC, how to randomize data of it...please help!
    By Unregistered in forum Windows Programming
    Replies: 3
    Last Post: 06-24-2002, 02:26 AM