ColorFromColorDescriptor method (WinStudio scripts)

Applies To

IWSApplication interface

Definition

Takes a color descriptor string as input and returns the color as a Color data type.

Syntax

object.ColorFromColorDescriptor( string )

  Part   Description
object Required. Name of a valid application object.
string Required. A string containing the RGB code value of the Color data type to be returned (see "Remarks").

Remarks

This method can be used whenever you want to work with a Color data type, when given a color descriptor string. Any WinStudio properties or methods that return a foreground or background color, return them as a color descriptor string.

The return value is a Color data type matching the RGB code.

The RGB string consists of a series of three comma-separated integers, each in the range 0-255. For example, the RGB code for a deep purple color might be rendered as (158,44,186).

This method must be used in conjunction with another method that requires a Color data type as input.

When using this method, you must include the following comment above the Imports section in any global or form script:

'//<Ref>System.Drawing.dll</Ref>

Example

Dim BackColor As Color
Dim BackColorDesc As String
BackColorDesc = Application.GetUserPreferenceValue("BaseFormBackColorDescriptor")
BackColor = Application.ColorFromColorDescriptor( BackColorDesc )
Related topics