问题
CComboBox contains one text edit window and a dropdown window. I intend to change the text edit control's height. Any suggestion is appreciated.
回答1:
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);
...
回答2:
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*/ );
来源:https://stackoverflow.com/questions/18684897/how-to-change-ccombobox-edit-controls-height