2011-01-01 wcdj
CComboBox::SetDroppedWidth
int SetDroppedWidth( UINT nWidth );
Call this function to set the minimum allowable width, in pixels, of the list box of a combo box.
Parameters
nWidth
The minimum allowable width of the list-box portion of the combo box, in pixels.
Return Value
If successful, the new width of the list box, otherwise CB_ERR.
Remarks
This function only applies to combo boxes with the CBS_DROPDOWN or CBS_DROPDOWNLIST style.
By default, the minimum allowable width of the drop-down list box is 0. When the list-box portion of the combo box is displayed, its width is the larger of the minimum a

本文介绍了如何使用C++的CComboBox类的SetDroppedWidth函数来设置下拉列表框的最小宽度,确保长字符串能完全显示。通过获取组合框中每个项目最宽的字符串并考虑滚动条和边距来调整宽度。同时,提供了示例代码展示如何在对话框中应用此函数。
最低0.47元/天 解锁文章
6712

被折叠的 条评论
为什么被折叠?



