开发者

How can I force a listbox to a certain height? (height is automatically adjusted so the bottom row is not partially visible)

开发者 https://www.devze.com 2023-02-06 23:16 出处:网络
I am resizing and positioning a listbox like this: Rectangle r (x, y, width, height); listbox->Bounds = r;

I am resizing and positioning a listbox like this:

Rectangle r (x, y, width, height);
listbox->Bounds = r;

The height seems to be automatically adjusted to become a multiple of the height of an item. (Making these numbers up): 开发者_如何学JAVAIf the height of each row is 10, and I set the listbox height to 105, it is automatically adjusted to become 100. This happens even when the listbox is not populated. The result is a minor cosmetic problem occurring when the user re-sizes the window (and the listbox is re-sized along with it).

Is there a way to force the height?


Setting the IntegralHeight property to False allows the partial display of items. The ListBox height can then be adjusted arbitrarily.

0

精彩评论

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