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

    Storing elements in a combo box

    I have a combo box in a dialog box. I have associated with a variable. I am trying to fill elements in the combo box. I have used the data option provided in the properties, SendDialogItem Method(no error but no effect) & also the m_combo.AddString(Error message) but none have worked. Can you pl. help me.



  2. #2
    Join Date
    Apr 1999
    Posts
    11

    Re: Storing elements in a combo box

    AddString should work. You just pass a CString which is then added to the list. Remember to set the size of the dropdown list in resource editor by first clicking on the comboboxes dropdown arrow and than dragging the lower blue dot to size the list... What exactly doesn't work ? Getting any error message using AddString !??


  3. #3
    Guest

    Re: Storing elements in a combo box

    Do you get Error Message when you try to add strings thru AddString. Then please check the type of variable you have associated with the ComboBox control. It should be of type CComboBox.


  4. #4
    Join Date
    Apr 1999
    Location
    Pakistan
    Posts
    207

    Re: Storing elements in a combo box

    Thanks its working.


  5. #5
    Join Date
    Apr 1999
    Location
    Pakistan
    Posts
    207

    Re: Storing elements in a combo box

    Thanks for your help. Actually I was using the wrong type. How can we increase the size of combo box programatically?


  6. #6
    Join Date
    May 1999
    Posts
    116

    Setting drop down size

    In orrder to set the drop down size, you just change the height of the combo. The height of the combo is actaull the height of the edit/static control and the drop down list. (Call GetWindowRect on it and observe the results). To change the height of the edit/static control you must use CComboBox::SetItemHeight(-1, nHeight);


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