UI Interest Group Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Scrollbar button dimensions

Solved!
Go to solution

Does anybody know how to query the dimensions of the buttons on either end of a System Scrollbar? I don't see a LV property that gives the value, and I need it to offset what's written to the "Scrollbar:HousingLength" property so that the buttons overhang the plot area of my graph. My app could be installed on multiple versions of Windows, so I need to query it from the system somehow.

scrollbar.png

0 Kudos
Message 1 of 9
(11,957 Views)

Just a quick reply from my phone, but aren't the end buttons a fixed dimension in System style sliders? If so, could you maybe just keep an internal constant (or a constant per O.S. type) and use that in place of a native property? Just a thought...

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 2 of 9
(6,157 Views)

They're fixed for a given installation and OS config, but I'm pretty sure they change size if you enable usability features like larger fonts, and I know that in Win XP you can customize the size of scrollbars in the display settings.

0 Kudos
Message 3 of 9
(6,157 Views)

That's a good point, but I wouldn't assume the LabVIEW System controls obey the O.S. accessibility settings, because native LabVIEW System controls are not actual system controls, but lookalike copies, so there's the possibility that their sizes are fixed. I'd check it out myself as I'm now curious, but I'm nowhere near my computer, so I'm afraid I can prove this. Can you create a quick executable with a few system controls on it and try altering your system settings to see if they change size?

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 4 of 9
(6,157 Views)

Thoric wrote:

That's a good point, but I wouldn't assume [anything about the LV System Controls].

That's why I posted here.

Can you create a quick executable with a few system controls on it and try altering your system settings to see if they change size?

Maybe later this week, if the answer isn't obvious to anybody else subscribed to this forum..

0 Kudos
Message 5 of 9
(6,157 Views)

Going back a few years I used VB 6 and for the controls every dimension was given in 'twips', to get the actual size on screen of an object on screen you had to multiply by twips per pixel. This value would change with screen ratios and resolutions. I would expect this behaviour on system controls. I will see if I can find these values through LabVIEW today.

0 Kudos
Message 6 of 9
(6,157 Views)

I checked and twips ar outdated, however you can query the pixels per inch of the screen as this is what the accessibility functions set. The heights and width of the buttons does change with the ppi as well as all of the font sizes. The actual controls do not seem to change size though. I have included the VI to find the ppi and put extar controls on its front panel to view the changes in button size. Also included are the three images I took of the front panel at 96ppi, 120ppi and 144ppi.

By the way ppi is obviously not ppi as pixels on your screen don't change in density, so changing ppi actual changes the size of the inch, so much so SI units.

buttons.png

96dpi.png

120dpi.png

144dpi.png

code.png

Message 7 of 9
(6,157 Views)
Solution
Accepted by David_Staab

I believe the buttons are always square, so you only need one of the dimensions.  You can query that dimension directly using the Bounds property (height or width, depending upon horizontal or vertical scrollbar).  A visible label will mess this up for horizontal scrollbars, so either hide the label while you take the measurement, or subtract its size from the height.

0 Kudos
Message 8 of 9
(6,157 Views)

Mike, this is the "right" way to handle any similar situation -- ask the OS for what you need to know -- and I appreciate your effort in posting it. However, Dr. Damien's solution appears to work for all situations, and it's much easier, so I'm going to mark his as the preferred option when working in LV.

Message 9 of 9
(6,157 Views)