views:

401

answers:

1

Hi guys,

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. 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.

+1  A: 

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.

Paul Sasik
Thanks for your answer.I am talking about the size when the control is closed. I only want it to have the same Height as a TextBox with the same font size.BTW: I already implemented an auto-complete feature.
thelost
Yeah. That is tough. Unfortunately all controls that display text are governed by the font size but have different sized borders and slightly different alignments. Notice that the combo box is a text control hosted within another control which adds some border "padding". The only thing i ever figured out to make it look nicer next to each other to instead align on the content within those controls. e.g. the bottom line of the texts within a text box and combo box ought to be aligned. That looks pretty enough. Trying to force a size is tough. Though you may look at 3rd party controls.
Paul Sasik
thelost