Link to home
Start Free TrialLog in
Avatar of pepr
pepr

asked on

Size of the listbox of combo box (Windows)?

Hi,

I am polishing rather old GUI of the application. The window is resizable -- home made layout is programmed via MoveWindow() (created in the pre-window-layout-manager era). One of the used controls is a combo-box. The rectangle of the combo box is set to determine the desired size of the list box when the combo is dropped down. However, the rectangle goes out of the window. It overlaps also the tab rectangle and causes the frame around the tab display area to be erased even when the combo box is closed -- see the circled areas on the image and the missing tab border between the two circles.

The question is how it should be done correctly?

Thanks,
    Petr
2009-03-31-160105.png
ASKER CERTIFIED SOLUTION
Avatar of JohnGaby
JohnGaby
Flag of Afghanistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pepr
pepr

ASKER

OK. The problem of the JohnGaby's recomendation is that CB_SETMINVISIBLE requires common controls version 6. This way it does not work in Win 2000. Is it true? (Not having Win2000 in hands.)

Is it possible to implement something like CB_SETMINVISIBLE caused behaviour "easily" also for Windows 2000? Or would you prefer to capture CBN_DROPDOWN, get the handle of the listbox part and move it?
Have you tried it under Win 2K and seen that it doesn't work?  I seem to recall that the common controls are updated when you install updated versions of IE, but perhaps I am mistaken.

You might be able to set the size yourself as itsmeandnobodyelse suggested, but you would probably have to do it in response to the CBN_DROPDOWN notification message.

http://msdn.microsoft.com/en-us/library/bb775810(VS.85).aspx
Avatar of pepr

ASKER

I did not try as I have no Win 2000 around. I will try it a bit later.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pepr

ASKER

Thanks to both! It helped.