ComoBox and DPI 120

The place for threads about TimoSoft ComboListBoxControls
anditop
Cadet
Posts: 7
Joined: 29 Apr 2010, 10:59

Re: ComoBox and DPI 120

Post 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
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Re: ComoBox and DPI 120

Post 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?
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
anditop
Cadet
Posts: 7
Joined: 29 Apr 2010, 10:59

Re: ComoBox and DPI 120

Post 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 ...
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Re: ComoBox and DPI 120

Post 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.
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
anditop
Cadet
Posts: 7
Joined: 29 Apr 2010, 10:59

Re: ComoBox and DPI 120

Post 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!!
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Re: ComoBox and DPI 120

Post 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.
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Post Reply