Programmatically Change Font, Color, or Size of String Subset in LabVIEW

您所在的位置:网站首页 stm32怎么改字体大小 Programmatically Change Font, Color, or Size of String Subset in LabVIEW

Programmatically Change Font, Color, or Size of String Subset in LabVIEW

#Programmatically Change Font, Color, or Size of String Subset in LabVIEW| 来源: 网络整理| 查看: 265

You can programmatically change the font of a subset of text from a string control or indicator by following these steps: Right-Click on the string control or indicator and select Create禄Property Node禄Text禄Selection禄StartRight-click on the Text.SelStart property and select Create禄Constant. This specifies the offset of the first character of the selected text.Expand the property node to expose a second property.Left-click on this聽second property and select Text禄Selection禄End.聽Right-click on the Text.SelEnd property and select Create禄Constant. This specifies the offset of the last character of the selected text.聽Expand the property node to expose a third property.聽Left-click on the third property and select Text禄Font聽>> then the font property to be programmatically controlled.聽 For example: Select聽Text >> Font >> Color聽to bring up the Text.FontColor property on聽the Property Node. Right-click on the property's input node to Create Constant, then left-click on the created Color Box Constant聽and聽select a color from the palette. Repeat steps 6 and 7 to programmatically control additional font characteristics for the selected text. Note: The Text >> Font properties (like Text.FontColor and Text.FontBold) will change the formatting for only the text selection (from SelStart to SelEnd indices). The Text >> Text properties (e.g. Text.TextColor) will change formatting for all text in the string.

The snippet below provide an example of different ways you can apply these properties.聽Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.

The outcome of the code above is the following formatted string control.

Additional Information Remember that if you need this configuration to be used in several controls at the same time, you can create a Type Definition or a Strict Type Definition according to your needs. The differences are explained in the following document:聽Differences Between Type Definitions and Strict Type Definitions.聽There are numerous changes you can make to string characteristics. Use the LabVIEW manual or Context Help for each property you have questions on.聽


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3