Style/End Style: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
Line 7: Line 7:
The Style statement allows you to embed pure css style rules in your app. This allows you to have additional functionality to your app. Statements within this block must follow all css rules. They are ignored by AppStudio itself. For more information, see the Tech Note ‘The role of JavaScript, HTML5 and WebKit’.
The Style statement allows you to embed pure css style rules in your app. This allows you to have additional functionality to your app. Statements within this block must follow all css rules. They are ignored by AppStudio itself. For more information, see the Tech Note ‘The role of JavaScript, HTML5 and WebKit’.


Style rules are automatically global and loaded at startup. They are not executed as part of the flow of control of your app. To change the style of a control at runtime, use
Style rules are automatically global and loaded at startup. They are not executed as part of the flow of control of your app. Do not put a style block inside a [[Sub]] or [[Function]].
 
To change the style of a control at runtime, use
<pre>
<pre>
   myControl.style.backround = "red'
   myControl.style.backround = "red'

Revision as of 15:38, 26 May 2014

Style

[statements]

End Style

Description

The Style statement allows you to embed pure css style rules in your app. This allows you to have additional functionality to your app. Statements within this block must follow all css rules. They are ignored by AppStudio itself. For more information, see the Tech Note ‘The role of JavaScript, HTML5 and WebKit’.

Style rules are automatically global and loaded at startup. They are not executed as part of the flow of control of your app. Do not put a style block inside a Sub or Function.

To change the style of a control at runtime, use

  myControl.style.backround = "red'
 
  'or
  $(myControl).css("background", "red")

Example (Basic)

'This sample shows how to change the appearance of a button in your code.
 
Style 
  #Button1 {background: red}
End Style 

Example (JavaScript)

// This sample shows how to add a button at runtime.
 
</script><style>
  #Button1 {background: red}
</style><script>

Output

(a button and a box are displayed. Click the button and text is put in the box)

Related Items

JavaScript