How to change CComboBox edit control's height?

独自空忆成欢 提交于 2020-05-13 14:42:26

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!