2

I am using a class that is the descendant of CCombo Box. How can I set the maximum allowable width of its drop down list?

What I concluded from internet surfing is that there is no such method in CCombo Box class. Someone please help me in this regard.

Thanks in advance.

Itban Saeed
  • 1,660
  • 5
  • 25
  • 38

1 Answers1

4

CComboBox::SetDroppedWidth:

Call this function to set the minimum allowable width, in pixels, of the list box of a combo box.

The function is supposed to send CB_SETDROPPEDWIDTH message to the control window.

IInspectable
  • 46,945
  • 8
  • 85
  • 181
Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • But I want to set the maximum allowable width, because my drop down list size is almost four times bigger than the size of combo box itself – Itban Saeed Aug 12 '15 at 09:16
  • "The width of the list box is either the minimum allowable width or the combo box width, whichever is larger." This means that if your width is effectively four times bigger, this is the width the application requested itself because normal width is the width of the control. – Roman R. Aug 12 '15 at 09:19
  • So how should I fix this problem ? – Itban Saeed Aug 12 '15 at 09:20
  • @ItbanSaeed: _So how should I fix this problem?_ Call the `SetDroppedWidth` method with the desired width. Where is the problem? – Jabberwocky Aug 12 '15 at 09:48
  • 1
    Your description of the problem is not consistent. You tried something else or described it wrong. Update your question to show what you tried, and screenshot of what you get and what you want to get. – Roman R. Aug 12 '15 at 09:55
  • @ItbanSaeed : "it didn't work" is one of the most used phrases in SO questions. What did you do exactly (show some code)? What was the result (maybe show some screendump)? And what result did you expect (showing an image could be helpful as well)? – Jabberwocky Aug 12 '15 at 10:50