Thread: Adding data to list boxes

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    9

    Question Adding data to list boxes

    Is there a way I can dynamically add and remove data items to the list box part of a combo box from within an application?
    many thanks Bazz

  2. #2
    You can use SendMessage or SendDlgItemMessage(if you are using a dialogbox)

    example:
    SendDlgItemMessage(hDlg,IDC_COMBO,CB_ADDSTRING,0,( LPARAM)text);

    and to select the default value you can use
    SendDlgItemMessage(hDlg,IDC_COMBO,CB_SELECTSTRING,-1,(LPARAM)text);


    hope this helps

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Bitmasking Problem
    By mike_g in forum C++ Programming
    Replies: 13
    Last Post: 11-08-2007, 12:24 AM
  2. Problem with linked list ADT and incomplete structure
    By prawntoast in forum C Programming
    Replies: 1
    Last Post: 04-30-2005, 01:29 AM
  3. instantiated from here: errors...
    By advocation in forum C++ Programming
    Replies: 5
    Last Post: 03-27-2005, 09:01 AM
  4. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  5. linked list inside array of structs- Syntax question
    By rasmith1955 in forum C Programming
    Replies: 14
    Last Post: 02-28-2005, 05:16 PM