LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Command button height limited to a minimum of 23 pixels

Why is command button height limited to a minimum of 23 pixels when saving .uir files? Using "Control Coordinates" I can set the button height between 15-23, but when I save the .uir file and reopen, the button height is forced to 23. This limitation doesn't seem to apply when programmatically setting the button height. The minimum height when setting programmatically is 15. CVI help doesn't mention anything about minimum height.
0 Kudos
Message 1 of 5
(3,396 Views)
The minimum height appears to be related to the label font size, even if you delete the label text. If you make the font smaller, you can make the button smaller.
In the UI Editor, double-click on the control to edit it, then click on Label Style and change the font size.
I don't see the command button height change when I save then reload the UIR in LabWindows 6.0.
0 Kudos
Message 2 of 5
(3,391 Views)
I am using LabWindows 7.1.1. I am using the default font size of 11 and I don't want to make it smaller. What's frustrating is that a button height between 15-23 can still accommodate a font size of 11. NI must be forcing the height to 23 to include margins above and below the label text. Also frustrating is the lack of consistency between setting height in the UI editor and setting height programmatically. For now I'll just set the button height programmatically.
0 Kudos
Message 3 of 5
(3,381 Views)
By default, command buttons have the Auto Sizing attribute set to Grow Only. This attribute is enforced whenever the label text changes, but also when the panel is loaded. When this attribute is enforced, it ensures that the button is wide enough, and high enough, to accomodate its label, including a small buffer area on all four edges.

The idea behind enforcing this attribute at load time is that oftentimes panels are loaded in computers where the default font is different (and possibly much larger) than the font with which the button was saved.

If you don't want this behavior, change the Auto Sizing setting in the Edit Command Button dialog from Grow Only to Never Auto Size.

Luis
NI
Message 4 of 5
(3,359 Views)
Thank you. This is very helpful. I had not used the Auto-Sizing property before, but now I understand its use.
0 Kudos
Message 5 of 5
(3,346 Views)