怎么设置一个combobox的下拉框的高度?
上次再这里看到了一个说是设定一个combobox的宽度的API,有谁知道设定它高度的函数是什么吗~~给小弟个提示~~谢啦`~
经验证正确后,马上给分
问题点数:20、回复次数:4Top
1 楼jjwwang((空园歌独酌,春日赋闲居))回复于 2006-05-03 20:57:13 得分 0
SendMessage(ComboBox1->Handle, CB_SETDROPPEDWIDTH, 1000, 0 );Top
2 楼day_dreamerabc(流浪牛)回复于 2006-05-04 11:34:22 得分 0
这个不就是改变ComboBox下拉框宽度的API吗?难道是后面那两个参数在起作用,请指点下~Top
3 楼jjwwang((空园歌独酌,春日赋闲居))回复于 2006-05-04 11:56:55 得分 20
sorry,没看清楚.
SendMessage(ComboBox1->Handle, CB_SETITEMHEIGHT, 0, 50 );
设置每一项的高度
下面是API说明.
An application sends a CB_SETITEMHEIGHT message to set the height of list items or the selection field in a combo box.
CB_SETITEMHEIGHT
wParam = (WPARAM) index; // item index
lParam = (LPARAM) (int) height; // item height
Parameters
index
Value of wParam. Specifies the component of the combo box for which to set the height.
This parameter must be -1 to set the height of the selection field. It must be zero to set the height of list items, unless the combo box has the CBS_OWNERDRAWVARIABLE style. In that case, the index parameter is the zero-based index of a specific list item.
height
Value of lParam. Specifies the height, in pixels, of the combo box component identified by index.
Return Values
If the index or height is invalid, the return value is CB_ERR.
Remarks
The selection field height in a combo box is set independently of the height of the list items. An application must ensure that the height of the selection field is not smaller than the height of a particular list item.Top
4 楼day_dreamerabc(流浪牛)回复于 2006-05-04 11:58:25 得分 0
谢谢风归叶Top




