CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    3

    How to add integer items in ComboBox

    I want to add integers in combobox list but couldn't do ?
    Will anyone help me out ?
    Rakesh

    RHardaha

  2. #2
    Join Date
    Apr 1999
    Posts
    51

    Re: How to add integer items in ComboBox

    Try formating the integers into a CString with ::Format:

    CString t_cTemp;
    t_cTemp.Format("%d",myint);
    m_MyCombo.AddString(t_cTemp);


    Steven M. McNeese
    [email protected]

  3. #3
    Join Date
    May 1999
    Posts
    318

    Re: How to add integer items in ComboBox

    The first response of steeve is good if you want to add an integer as string in a combobox.

    But if you want to link an integer to each item of your combobox use GetItemData and SetItemData methods of the CComboBox class.

    I hope this could help.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured