LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Vertically Center Displayed Number in Numeric Control

Solved!
Go to solution

Dear All,

 

I'd like to use a simple numeric control (or indicator) with a height that can be adjusted. The only available option is in the Classic palette -> Classic Numeric -> Simple Numeric. This creates a nice, simple, numeric control with adjustable height. However, if you make the control taller (for example, right click on the control and chose properties, height = 24, so the height of the control is two times the default front panel grid size) the number displayed in the control does not stay centered vertically.

 

Here is the control with default size (default height  = 19):

 

Default.PNG

 

Here is the same control with the height set to 24:

 

Height24.PNG

 

I would like to make the height 24px while keeping the number centered vertically. Has anyone had a similar question and found a solution? I would be happy for any advice.

 

Best,

Ed

0 Kudos
Message 1 of 11
(3,838 Views)

Hi edward,

 

change fontsize to ~20 to have the number vertically centered… 😄

 

Other workarounds

- use a picture indicator and "draw" your text at the exact position you want to have…

- use a transparent indicator showing your number and place it over a graphics/image of the border and background…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 11
(3,824 Views)

Attached.

 

 

George Zou
0 Kudos
Message 3 of 11
(3,789 Views)

Hi George,

 

Thanks for sending the control. When I open the attached control in LabView 2014 I see the height as 26. I also can't change the height of the control.

 

Best,

Ed

0 Kudos
Message 4 of 11
(3,739 Views)

That must be the font you use.  If you use app./system font, what OS are you using?

For system numeric control, you can NOT change the height in edit mode.

It automatically adjust to the font size (if > 24).

George Zou
0 Kudos
Message 5 of 11
(3,734 Views)

I changed the font to Segoe UI 13pt

Untitled.png

 

 

George Zou
0 Kudos
Message 6 of 11
(3,729 Views)
Solution
Accepted by topic author otheredward

Customize the control this way.

Capture1.PNG

  • Drop a Numeric on a BD
  • Create a P-Node Numeric Text.size.Height
  • Create a control for that value
  • run the vi
  • Select the Control and Create a type def
  • Edit the type def By:
  • Make the part Numeric Text Transparent
  • Move it down until text is centered Adjust height
  • Select the Frame and set its background White
  • Adjust Height and Top of Inc/Dec arrows
  • Let radix resize itself

Add an Icon, save and apply changes. Bingo!

 

Silly workaround but if you need it you need it


"Should be" isn't "Is" -Jay
Message 7 of 11
(3,718 Views)

> Make the part Numeric Text Transparent

> Move it down until text is centered Adjust height

> Select the Frame and set its background White

 

When you change the background color, there will be no difference between control and indicator.

 

George Zou
0 Kudos
Message 8 of 11
(3,715 Views)

@zou wrote:

> Make the part Numeric Text Transparent

> Move it down until text is centered Adjust height

> Select the Frame and set its background White

 

When you change the background color, there will be no difference between control and indicator.

 


TRUE but, in a where used case, you can "disconnect from typedef" and recolor the frame at edit time.  I mentioned it was a flawed work-around.  No other options would be possible even with an X-Control since frame BG Color has no p-node support. (sad)


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 11
(3,706 Views)

Why not simply skip those change color steps?

Works fine without those steps for system control.

 

George Zou
0 Kudos
Message 10 of 11
(3,697 Views)