How to change CComboBox edit control's height?

2.7k Views Asked by At

CComboBox contains one text edit window and a dropdown window. I intend to change the text edit control's height. Any suggestion is appreciated.

2

There are 2 best solutions below

0
On

From MSDN:

Call the SetItemHeight member function to set the height of list items in a combo box or the height of the edit-control (or static-text) portion of a combo box.

m_comboBox.SetItemHeight( -1 /*edit control*/, 15 /*height in pixels*/ );
1
On

Set font of Combobox control.

// *.h
CComboBox m_combo1;

// *.cpp    
CFont comboFont;
comboFont.Create(18, 0, 0, 0, FW_BOLD, FALSE, FALSE, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
        CLIP_DEFAULT_PRECIS, CLEARTYPE_NATURAL_QUALITY, DEFAULT_PITCH | FF_SWISS, _T("Arial"));

m_combo1.SetFont(&comboFont);
...