Unable to set Height and Width of a form

U

Udi

All,
I have a list box that imitates the intelisence behavior.
Since I need it to be top most, I have put it on a TopMost form (The
listBox docked to Fill).
The form has no parent, no caption and its borderStyle is FixedSingle.
The Listbox IntegralHeight is false.

My problem is that when my listbox contains only one or two items in
it, I can't shrink the parent form to the wanted sizes.
The result is a listbox (form) bigger than needed (In both Height and
Width).
It seems like when the list contains enough items (more than 2 for that
matter),
setting the form Height works fine, but again the Width still doesn't
work.

for example, the line:

this.autoCompForm.Height = 26;

results with Height equals to 34.
Same behavior happens when I try to set Width to a value lesser than
123.

I have searched my code, there's no other place that I touch these
properties.


Any Ideas?
This is really frustrating...
Thanks!
Udi.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,


IIRC there is a minimun size for a new window being created.

If you set the border style to SizableWindowTool you can set it even smaller
( 34,26 IIRC )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top