|Re: Setting visible items count in Combo dynamically [message #541729 is a reply to message #541329]
||Tue, 22 June 2010 07:07
Registered: July 2009
You could compute the number of items and set it to the combo using setVisibleItemCount().
You can do something like this:
Rectangle rect = display.getClientArea();
int itemCount = rect.height/combo.getItemHeight();
If you want the dropdown items to be shown only below the combo then you can compute it based on the position of the combo.
Point point = display.map(null, combo, rect.width, rect.height);
itemCount = (point.y - combo.getTextHeight())/combo.getItemHeight();
Lakshmi P Shanmugam
Powered by FUDForum
. Page generated in 0.03896 seconds