Sponsored Ad

Wednesday, November 25, 2009

C# Bugs List Box

The Problem

Docking a ListBox - either in a form or a panel - can be very frustrating for the first time round!

Create a new project, insert a ListBox to the form, then fill the bench of the ListBox.

clip_image001

Notice that when you resize the form the ListBox appears to undock itself from the bottom part of the form.

clip_image002

clip_image003

The Solution

The problem is caused by the ListBox trying to ensure that only the full articles can be seen - this is why ListBox shocks from one height to another when you resize the form. The solution is simply to tell you to forget that only whole articles. This is done by setting the property to false IntegralHeight

clip_image004

Once this is established you can resize the form to any size and the ListBox will always remain in the same distance from filling the bottom of the form.

clip_image005

0 comments:

Post a Comment

Sponsored Ad

More Related Articles

Website Update

Followers