开发者

C#: Set ComboBox Height

I'm trying to set the Height of a ComboBox in C#.NET CF / WinCE6. So far I managed to do it by using the MessageWindow.SendMessage() with CB_SETITEMHEIGHT开发者_StackOverflow社区. The issue is the ComboBox gets to its initial Height when being clicked.

Is there a workaround for this ?

LE: How would this affect performance, considering the ComboBox might store 1k entries ?

Thanks.


One thing you could do to overcome the resetting of the combo box height is to set your SendMessage solution on a timer, say once every 250ms or something like that.

Btw, are you talking about DropDownHeight or the actual control's height? If it's the latter you can actually resize it by increasing the size of the font. That's what the combo box' size is keyed on and why you're losing that dimension upon interaction with it.

But your plan to store 1k entries in a combo box on a handheld device is a usability issue. It's hard to pick things out of a list on a combo box when there are few items to choose from. If you put 1k items into the list you will be forcing the user to scroll which is a very tough thing to do even for experienced Windows users due to the size of the scroller, the stylus and the weird nature of some of the touch screens out there. You should think about a filtering process whereby you limit the number of items in the combo box by several orders of magnitude.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜