Properties and Methods

From NSB App Studio
(Redirected from Properties)
Jump to navigation Jump to search

Description

Properties define the appearance and operation of controls. They are edited in the Properties Window window of the IDE. The properties described here are common to most controls. Properties that are specific to certain controls are discussed in the documentation for that control.

Property Description
addChild(control) Adds control as a child of the control. Works best on controls are containers.
background The color of the background of the control. Same values as color, plus transparent.*
borderColor The color of the border. Defaults to gray. Can be name, #RRGGBB or rgb(R,G,B).
borderStyle The appearance of the border. Defaults to solid. Can be "dotted","dashed","solid","double","groove","ridge","inset","outset".
borderWidth The width, in pixels, of the border. Default is 0, for no border.
bottom The bottom of the control in pixels, in pixels, percent or 'auto'. This usually just calculated automatically from top + height.
class The css class to be used for the control. Settings in the class may override the values of other properties.
color The color of the text. Can be a color name, value (#RRGGBB) or rgb(r,g,b) function.*
corners Should the corners of the control be square or rounded? (jQuery Mobile) *
disabled** The control is grayed out and will not accept input. Use .disabled=True or False to change this at runtime. Do not set in global code - should be in Sub Main() instead.
events Brings up list of events. Select one to go to the code for that event.
fadeIn(x) Shows widget using effect. x can be milliseconds, "fast" or "slow": Button1.fadeIn(1000) Runtime only. Not for Modal forms.
fadeOut(x) Hides widget using effect. x can be milliseconds, "fast" or "slow": Button1.fadeOut("slow") Runtime only. Not for Modal forms.
focus() Place the cursor in the control. Runtime: TextBox1.focus(). Like setFocus in VB. Runtime only.
fontFamily The name of the font.*
fontSize The text size, in pixels.*
fontStyle The style of the text. Can be normal, italic or oblique.*
fontWeight The thickness of the text. 100 to 900, higher values are darker.
height The height of the control in pixels, in pixels, percent or 'auto'.
hidden* True/False. Is the control hidden? Runtime method: Button1.hidden=True
hide() Runtime method: i.e. Button1.hide() Runtime only.
id The name of the control. The id is used to refer to the control in your program. It has to follow JavaScript naming conventions. First digit cannot be a number.
left The left bound of the control in pixels, in pixels, percent or 'auto'.
margin-all Margin to leave outside the control on all sides.
margin-bottom Margin to leave outside the control on bottom.
margin-left Margin to leave outside the control on left.
margin-right Margin to leave outside the control on right.
margin-top Margin to leave outside the control on top.
mini Show the control a bit smaller, with a smaller font. jQuery Mobile. *
name The name of the control. Optional: this field is used to POST data from a form.
padding-all Padding inside the control between its content and all bounds.
padding-bottom Padding inside the control between its content and the bottom of the control.
padding-left Padding inside the control between its content and the left of the control.
padding-right Padding inside the control between its content and the right of the control.
padding-top Padding inside the control between its content and the top of the control.
right The right side of the control in pixels, in pixels, percent or 'auto'. This usually just calculated automatically from left + width.
resize(left,top,width,height) Set the size and position of a control. Values can be number of pixels, percent of screen size or "auto". Percentages should be in quotes ("50%"). Does not work for Android 2.3 and older. Runtime only.
show() Runtime method: i.e. Button1.show() Runtime only.
slideDown(x) Shows widget using effect. x can be milliseconds, "fast" or "slow": Button1.slideDown(1000) Runtime only.
slideUp(x) Hides widget using effect. x can be milliseconds, "fast" or "slow": Button1.slideUp("fast") Runtime only.
style The style of the control. Optional. Any valid HTML Style string can be used. Separate parameters with “;”. Example:

color:blue; text-align:center;

theme The color theme to use. ‘a’ is white, ‘b’ is black. Other letters can be custom defined using ThemeRoller. jQuery Mobile only.
top Position of the top of the control, in pixels, percent or 'auto'.
width The width of the control, in pixels, percent or 'auto'.
Visible Gets or sets whether control is visible. Can be True or False.

* Not available for all controls. Not implemented on all devices.

** Not recognized by ontouch events. Check for disabled state in event code and handle there.

Related Items

Events, Controls