Editing the Labels of Buttons

Boolean controls and indicators have Boolean text labels in addition to their owned labels. Boolean text labels change depending on the value of the control or indicator. Initially, most Boolean controls and indicators display the word ON in the TRUE state and the word OFF in the FALSE state. When you click the button with the Operating tool, the control toggles to the opposite state.

Tip Tip  Label the Boolean object so that its name corresponds to the state of the control or indicator. For example, use ON for TRUE and OFF for FALSE. Also, indicate the default state in parenthesis.

By default, the label centers on the button. Complete the following steps to practice manipulating the label.

  1. Add a push button to the front panel.

     Add  Find
  2. Right-click the button and select Visible Items»Boolean Text from the shortcut menu. The word OFF appears on the Boolean button.
  3. With the Positioning tool, select the text and move it to the location you want. Also, you can select Lock Text in Center from the shortcut menu to return the text to its default location. To unlock the text, right-click the Boolean button and select Release Text from the shortcut menu.
  4. Use the Labeling tool to change the text in either state. For example, change ON to YES.
  5. Select the Boolean text and use the Text Settings pull-down menu on the toolbar to change the font, size, and color of the text.
  6. Hide the Boolean text from both states by right-clicking the button and selecting Visible Items»Boolean Text from the shortcut menu.

By default, you can change the label for each state of labeled buttons located on the Controls palette. To do so for labeled buttons such as OK and Cancel buttons, you must edit the button to allow different text strings for each state.

Complete the following steps to edit a labeled button to allow multiple text strings.

  1. Verify that the Boolean text is visible. To display the Boolean text, right-click the control and select Visible Items»Boolean Text from the shortcut menu.
  2. Right-click the button and select Advanced»Customize from the shortcut menu to display the Control Editor window.
  3. In the Control Editor window, right-click the button and select Multiple Text Strings from the shortcut menu.
  4. Select File»Apply Changes.
  5. If you want to use the button in other VIs, save it as a custom control.

You also can use the Boolean properties to manipulate Boolean labels programmatically.