Skip to main content

getStyleProperty

info

This Widget Control is common to every widget. In the examples below, widgetID is the name (ID) you gave the widget on the canvas, and in scripts you access members in the form widgetID.member.

Reads a property value from a style part applied to the widget. It works on the same target as setStyleProperty — style parts.

  • Parameters
    • styleName (string): Name of the target style part
    • styleProperty (string): Name of the part property to read
  • Returns: any - The property value. Returns null if the target part or property doesn't exist.

Example

const c = boxID.getStyleProperty("DecoratedBox", "color");
warning

This method can't read the "enabled" state that setStyleProperty sets — the part on/off toggle. It also returns null when the style name is wrong.