Page 2 of 2

Re: ComoBox and DPI 120

Posted: 07 Jun 2010, 08:57
by anditop
I tested on
- WinXP SP2 with comctl32.dll 5.82.xxx and 6.0.xxx
- Win7 with comctl32.dll 5.82.xxx
=> same behavior

Re: ComoBox and DPI 120

Posted: 13 Jun 2010, 16:18
by TiKu
I noticed that the problem occurs only if the overall height is very small. 240 twips are 16 pixels. If you set the height to 285 twips or larger, the problem seems to disappear. Can you confirm this?

Re: ComoBox and DPI 120

Posted: 14 Jun 2010, 08:55
by anditop
I cannot confirm this!

The problem disappear if I set the height smaller than approx. 300. If I set a larger value for "Height" property the dropdown (items list) itself has a maximum size of the "Height" value. It seems that there is a mix between "ItemHeight" and "Height" property.

I thought of using a smaller "Height" as a workaround but my VB6 resets the controls height back to 315 (default height?!) after the next compile ... very strange ...

Re: ComoBox and DPI 120

Posted: 14 Jun 2010, 18:46
by TiKu
At runtime the height, that the control reports, is the height of the combo field. At design time it's the height of the combo field and the drop-down list. It's implemented this way, because the native combo box uses the height to calculate the drop-down list's height, but VB6 uses the height to decide whether a mouse click is inside the control - so you could activate the control by clicking below it.

I cannot reproduce the behavior you described in your last post. On my system, the combo box behaves normally if the height is set to 285 or more twips (at runtime). For smaller values, the drop-down list gets the faulty 2 pixel height. The threshold of 285 twips might be different on other systems.

Re: ComoBox and DPI 120

Posted: 25 Jun 2010, 11:08
by anditop
Now I found (workaround) solution this problem:

If a create a control set of combo boxes (set index property in desinger to 0), all items that are loaded at runtime by "Load ..." are correct. So I set the control with index=0 to visible=false and use the runtime loaded controls only.

The same solution I found for a problem with RightToLeft=3 (also EditControls): There the designed item=0 (I used Textbox) does not move the cursor correctly, but item=1 to n has a correct behavior.

Maybe I can help you with this workaround for further problems.

Thank you for all!!

Re: ComoBox and DPI 120

Posted: 25 Jun 2010, 18:08
by TiKu
Thank you. The RightToLeft problem should be easy to fix - it sounds as if I'm trying to change the window style without recreating the window in a situation where the recreation is necessary. The ComboBox problem isn't that easy to fix. Simply recreating the control window if the height is changed would be way too slow, because height changes can happen quite often and if they happen, they are often time critical. But maybe I can use your findings to develop a work-around that doesn't need a control window recreation.