Window Scrollbar Is Too Wide and Obscures Data

Patrick Roth - Click for blog homepageA customer recently ran across an oddity on several (but not all) of their new Windows 7 machines.  The previous Windows XP machines being replaced were OK.

The issue was that on windows with scrolling windows, they noticed that the rightmost fields were partially obscured by the scrolling window scrollbar.

The screenshot below shows the issue in Sales Transaction Entry.

We can clearly see that the hundredths digit is fully obscured as well as about one half of the tenths digit.

Looking more closely (and I'll admit that I didn't as the users didn't complain about it!), we can see that the menu items are also larger than normal.  Had I noticed that I might have thought about this previous article and I could have saved myself a bit of research.  But then again the symptoms were not exact and either way I wouldn't have discovered this item of interest.

We might have assumed that the value is hard coded - but since we can see the scrollbar size is changed then obviously not.

So the question is, what determines how wide a scrollbar is drawn by Dexterity?

Like many of the settings of the GP UI, we ask Windows.  To get the scrollbar width value by using the GetSystemMetrics API function and passing it SM_CXVSCROLL.

By running the C# code snippet below, I determined that my setting (and apparently the default size for most) for this metric is 17.

C# Code Example

 public class PlatformInvokeTest { [DllImport("user32.dll")] public static extern int GetSystemMetrics(int nIndex); } int i; i = PlatformInvokeTest.GetSystemMetrics(2);

So what can affect this?

 

Our old friend the adjust Display window in Windows 7.

 

 

When we checked this setting on the affected machines, some users had apparently changed this to the 125% & 150% values.

 

By changing this back to 100%, the issue was resolved.  So not exactly like the issue David details in the referenced blog post but in the ballpark.

 

So problem solved.

 

But thinking about it, what if I really wanted my Display set to 125 or 150% value for other reasons?  Is there any way to do this and not obscure my decimals?

 

As it turns out - yes.

 

After the Dexterity code gets the setting for the scrollbar using the referenced API call, it then checks the Dex.ini to see if there is an entry:

 

MaxSWScrollbarSize=XX

 

This value is the maximum size of the scrollbar desired and the Windows metric value returned is capped to that value.

 

So by adding the setting to the dex.ini:

 

MaxSWScrollbarSize=17

 

and relaunching Dynamics, my scrollbar is now more familiar looking.

 

 

Cheers,

 

Patrick Roth
Sr. Escalation Engineer

 

PS: I checked the Dynamics Top 100 voting and noted I'm not doing all that well.  I'm totally not above begging for votes.  So a typical blog post gets around 1500 hits and I'm therefore expecting about 1500 votes....