组合框项目高度 [英] ComboBox ItemHeight
本文介绍了组合框项目高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
如何在C#WinForm应用程序中更改ComboBox的ItemHeight
谢谢
Hi
How to change ComboBox''s ItemHeight in C# WinForm Application
Thanks
推荐答案
您可以使用 ^ ]属性,但使用此属性并非易事(您的ComboBox
必须是所有者绘制的).阅读 MSDN 链接的ItemHeight
属性的备注部分.
还要查看 MeasureItem [
You can use the ItemHeight[^] property, but using this property is not trivial (yourComboBox
must be owner-drawn). Read the remarks section from the MSDN link forItemHeight
property.
Also check out MeasureItem[^]. This page contains a very useful example for you. ;)
Oh, you CAN set it - and for ListBoxes, too.
Public Const CB_SETITEMHEIGHT = &H153
Public Const CB_GETITEMHEIGHT = &H154
Public Const LB_SETITEMHEIGHT = &H1A0
Public Const LB_GETITEMHEIGHT = &H1A1
使用:SendMessage(handleOfContro,CBxx/LBxx,0,PixelHeightInBytes);
http://msdn.microsoft.com/zh-CN /library/windows/desktop/bb775911(v=vs.85).aspx [
Use: SendMessage(handleOfContro, CBxx/LBxx, 0, PixelHeightInBytes);
http://msdn.microsoft.com/en-us/library/windows/desktop/bb775911(v=vs.85).aspx[^]
这篇关于组合框项目高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文