CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: combobox

  1. #1
    Guest

    combobox

    Users are allowed only to pick an item in the list. How to achieve that?

    I am thinking to intercept "Setforcus" message, and send "dropdown" list message. How should I do that?

    Thanks!

    Daohui Li


  2. #2
    Guest

    Re: combobox

    Combo boxes are very versatile, but lets keep it simple, lets, suppose you want to specify the contents yourself.
    (Study the class members of CComboBox)

    m_MyCombo.AddString("Bert");
    m_MyCombo.AddString("Fred");
    m_MyCombo.AddString("Tim");

    m_MyCombo.SelectString(0);

    Set properties of your combo to Dropdownlist, and this stop character input in the combo, and only allow a selection.

    Use GetCurSel() to retrieve the item index selected
    Use GetLBText() to get the text at a given index

    I hope I have been helpful



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