Home Search

DriveWorks Pro 24
How To: Format Text (KB13021901)

Send Feedback

How To: Format Text

The text displayed on form controls support the use of formatting tags to enable text decoration to be applied within strings of text.

This applies to the following form control properties:

Tooltip Text Property

The Tooltip Text property of all controls that support tooltips.

The hyperlink tags are not supported for the Tooltip Text property.

For example:

Items Property (Data Table)

The Items property of the Data Table control.

For example:

Syntax

The following syntax allows the formatting of text displayed on form controls:

Bold

To make text bold, use [b] at the start of the text, and [/b] at the end.

Example (no end tag)

"This is [b]bold text"

Will display as:

This is bold text

Example (with end tag)

To format just the word bold, the end tag will be required.

"This is [b]bold[/b] text"

Will display as:

This is bold text

Italic

To make text italic, use [i] at the start of the text, and [/i] at the end.

Example (no end tag)

"This is [i]italic text"

Will display as:

This is italic text

Example (with end tag)

To format just the word italic, the end tag will be required.

"This is [i]italic[/i] text"

Will display as:

This is italic text

Underline

To underline text, use [u] at the start of the text, and [/u] at the end.

Example (no end tag)

"This is [u]underlined text"

Will display as:

This is underlined text

Example (with end tag)

To format just the word underlined, the end tag will be required.

"This is [u]underlined[/u] text"

Will display as:

This is underlined text

Color

To color text, use [color RequiredColor] at the start of the text, and [/color] at the end.

Replace RequiredColor with the required color the formatting is to use.

Example (no end tag)

"This is [color red]red text"

Will display as:

This is red text

Example (with end tag)

To format just the word red, the end tag will be required.

"This is [color red]red[/color] text"

Will display as:

This is red text

Hexadecimal values can also be used

For example:

"This is [color #ff0000]red text"

Will display as:

This is red text

Transparency

Transparency is supported for the [color] format tag.

This can be specified by setting an additional two hex characters before the hex color code, for example:

For the tag [color #22000000] - the “22” will apply an almost transparent black color to the text.

There is also support for setting a hex color using the shortened hex code, which is the three character version so #FFFFFF will be #FFF.

The three character version also supports transparency through the addition of one extra character before the color code, for example:

[color #22000000] is equivalent to [color #2000]

Hyperlink (Open in same tab)

Please note

Hyperlinks are not supported on the Tooltip Text property or the Text property of the Clipboard Button, Dialog Button, Macro Button or Upload Control.

To format text as a hyperlink to open in the same tab it was selected from, use [url RequiredURL] at the start of the text, and [/url] at the end.

Replace RequiredURL with the required url the link will go to.

By default the following will apply:

  • The linked text will open the default browser, when clicked from a desktop application (DriveWorks Administrator, User, etc.).
  • When clicked from a form in a browser the link will open on the current page.

    The user must navigate back to the previous URL to return to the Specification

    If this is not desirable behavior use url-external.

  • The color of the displayed text (in between the url tags) will be the color applied to the corresponding color property of the control.
  • The linked text will have a transparency applied on hover.
  • The linked text will be underlined

Example (no end tag)

"This is [url https://www.driveworks.co.uk/]linked text"

Will display as:

This is linked text

Where the word linked will open the DriveWorks homepage.

Example (with end tag)

To format just the word linked, the end tag will be required.

"This is [url https://www.driveworks.co.uk/]linked[/url] text"

Will display as:

This is linked text

Hyperlink (Open in new tab)

Please note

Hyperlinks are not supported on the Tooltip Text property or the Text property of the Clipboard Button, Dialog Button, Macro Button or Upload Control.

To format text as a hyperlink to open in a new tab, use [url-external RequiredURL] at the start of the text, and [/url-external] at the end.

Replace RequiredURL with the required url the link will go to.

By default the following will apply:

  • The linked text will open the default browser, when clicked from a desktop application (DriveWorks Administrator, User, etc.).
  • When clicked from a form in a browser a new tab will open.
  • The color of the displayed text (in between the url tags) will be the color applied to the corresponding color property of the control.
  • The linked text will have a transparency applied on hover.
  • The linked text will be underlined

Example (no end tag)

"This is [url-external https://www.driveworks.co.uk/]linked text"

Will display as:

This is linked text

Where the word linked will open the DriveWorks homepage.

Example (with end tag)

To format just the word linked, the end tag will be required.

"This is [url-external https://www.driveworks.co.uk/]linked[/url-external] text"

Will display as:

This is linked text

Further Examples

Combining Formatting Tags

Any combination of start and end formatting tags can be used.

Example using all formatting tags used to format the complete sentence

"[color red][u][i][b]red, underlined, italic and bold"

Or

"[color red][u][i][b]red, underlined, italic and bold[/b][/i][/u][/color]"

Will result in:

red, underlined, italic and bold

Example to format the color of a hyperlink

"Click [color blue][url https://www.driveworks.co.uk/]here[/url][/color] to visit our homepage"

Will result in:

Click here to visit our homepage

Escaping Formatting Tags

There may be times where the tags used to format text are required to be displayed as text. In these circumstances escaping tags are required.

Example to display the formatting tag as text (and not format the string)

"Enter [b] for bold"

The following syntax is used:

"Enter [[b] for bold"

In this case the first [ character escapes the subsequent [b] characters, preventing the string from being formatted.

Quotation Marks

Quotation marks in rules are used to denote text as strings, when a quotation mark is required to be shown within the string it requires to be escaped.

To do this the quotes are required to be surrounded by other quotes.

Example to display a single " within a string

Use double quotes.

Syntax

"This is a single quote "" mark"

Will display as:

This is a single quote " mark

Example to display a single " at the end of a string

Use double quotes immediately before the end quote.

Syntax

"This is a single quote mark """

Will display as:

This is a single quote mark "

Example to display a double "" within a string

Use four quotes.

Syntax

"This is a single quote """" mark"

Will display as:

This is a single quote "" mark


Knowledge Base Article Ref:KB13021901