If a VI serves as a user interface or a dialog box, front panel appearance and layout are important. Design the front panel so users can easily identify which actions to perform. You can design front panels that look similar to instruments or other devices.
You can use events to enhance the functionality of user interfaces.
Controls and indicators are the main components of the front panel. When you design the front panel, consider how users interact logically with the VI and group controls and indicators. If several controls are related, add a decorative border around them or put them in a cluster. Use the decorations located on the Decorations palette to group or separate objects on a front panel with boxes, lines, or arrows. The objects on the Decorations palette do not display data.
Do not place front panel objects too closely together. Leave some blank space between objects to make the front panel easier to read. Blank space also prevents users from accidentally clicking the wrong control or button.
Avoid placing objects on top of other objects. Even partially covering a control or indicator with a label or other object slows down screen updates and can make the control or indicator flicker.
Assign specific names to buttons and use common terminology. Use specific names like Start, Stop, and Save instead of general names like OK. Specific button names make the VI easier to use.
LabVIEW uses fonts already installed on your computer. For instance, LabVIEW defines its built-in fonts as the default system font. When you move VIs between platforms, LabVIEW automatically updates its built-in fonts so that they match the default system font of the current platform. Additionally, if you attempt to display a VI that uses a font that is unavailable, LabVIEW substitutes the closest match. For example, if you try to view a VI that uses the Arial font on a computer which does not have the Arial font, LabVIEW substitutes the Arial font with a similar, installed font. LabVIEW substitutes colors similarly to how it substitutes fonts. If one of the colors of the VI is unavailable, LabVIEW substitutes the closest match.
If you use system colors for the objects on the backgrounds of the front panel and block diagram, then the appearance of the VI varies across systems. To view the current available system colors in the color picker, select Tools»Options then choose Colors from the left-hand menu. Deselect the checkbox next to Use default colors and click one of the eight color boxes to show the color picker. You can view the six available system colors in the lower right-hand corner of the color picker. These six system colors vary across computers, so any VI that uses system colors reflects the specific system colors of the current computer. There are pairs of colors for panel and object, window, and highlight for items like menus. For example, if you use the Panel & Object system color for the background of a front panel, the front panel background appears white on a computer that has the Panel & Object system color set as white, and it appears gray on a computer that has the Panel & Object system color set as gray. To change the six system colors that appear in the color picker, use the color utility on the operating system of your computer.
Refer to the NI Developer Zone for more information about system colors.
You can use splitter bars to create professional user interfaces on the front panel, such as toolbars or status bars. You can create a splitter bar to separate the front panel into multiple regions, called panes. Each pane acts similarly to a unique front panel. Each pane has its own set of pane coordinates and, and you can scroll each pane individually. Each pane has its own set of controls and indicators on it. The splitter bar separates the controls on one pane from those on another pane, yet the terminals for all controls are on the same block diagram.
When you create a new, blank VI, the front panel has a single pane that fills the window. The front panel owns this pane and is the pane's parent. When you place a splitter bar on a pane, the splitter bar replaces the pane in the front panel object hierarchy and creates two new child panes. The front panel owns the splitter bar, and the splitter bar owns the two child panes. If you place a new splitter bar on one of the child panes, the new splitter bar replaces that pane and becomes the parent of the two new child panes. This hierarchy forms a binary tree, and the front panel owns the top pane.
Refer to the Multi-Panel Front Panel using Splitter Bars VI in the labview\examples\general\controls\splitter.llb for an example of using splitter bars and panes.
Right-click a splitter bar and select one of the following shortcut menu options to configure splitter bars.
You also can use the Splitter properties to configure splitter bars programmatically.
Right-click a scroll bar in the pane, or right-click a splitter bar and select the pane you want to configure and select one of the following shortcut menu options to configure splitter bars.
If there are no splitter bars on the front panel, you can configure some properties of the single pane in the VI Properties dialog box. However, if you add a splitter bar to the front panel, LabVIEW limits the menu options in the VI Properties dialog box because the configurations cannot apply to all panes. You must configure each pane individually. For example, adding a splitter bar to the front panel dims the Scale all objects on front panel as the window resizes checkbox on the Window Size page of the VI Properties dialog box.
You also can use the Pane properties to configure panes programmatically.
Select File»VI Properties and select Window Appearance from the Category pull-down menu to hide the menu bar and scroll bars and to create VIs that look and behave like standard dialog boxes for each platform.
If a VI contains consecutive dialog boxes that appear in the same screen location, organize them so that the buttons in the first dialog box do not directly line up with the buttons in the next dialog box. Users might double-click a button in the first dialog box and unknowingly click a button in the subsequent dialog box. Users also might attempt to use the undo operation or keyboard shortcut <Ctrl-Z> while a VI is running. This can cause unexpected behavior in dialog boxes, such as a closed box reopening. To avoid this behavior, you can add an event structure to the VI and configure the Key Down event to filter out the command.
Use the system controls located on the System palette in dialog boxes you create.
When you design a VI, consider whether the front panel can display on computers with different screen resolutions. Select File»VI Properties, select Window Size in the Category pull-down menu, and place a checkmark in the Maintain proportions of window for different monitor resolutions checkbox to maintain front panel window proportions relative to the screen resolution.