Properties                                                                  Object

ObjectName.Property[ = value]

Description

Object properties are variables in objects. The required component, ObjectName, is a valid object expression that refers to an object added to a program with an ADDOBJECT statement. The required component, Property, is the name of a variable in an object. See below for a list of common object properties. The optional component, value, is assigned to the variable in the object. Changing a property of an object can change how an object is displayed and how it interacts.

Some properties affect the fundamental way an object appears, and should be set directly after the object is created.

Some properties are read-only and can only be set at design time. Not all properties are available at runtime to be read.

Table 21: Properties

Property Name

Legal Values

Comments

Alignment+

Integer
0 = Left Justify
1 = Right Justify
2 = Center
Justify

Text/Caption text alignment. Label, OptionButton

BackColor

Color (Integer)

Background color of object. Colors may be RGB values or the index of a color in the system palette.

BorderStyle

0 = none

1 = line

Date, Label, TextBox, Time

Bottom

Integer

Obsolete – use Height

Caption

String

Text displayed in object.

Date

Date type

Set the date, i.e.

Date.date=cdate("8/5/02")

Default

true/FALSE

Sets a button as the default option chosen when the enter key is used.

Dir To Include

Pathname

A comma separated list of directories of files to be installed with your app.

Enabled

True

Does object respond to user events?

Encrypted

TRUE/FALSE

Project Property only. If set, saved file will be encrypted. Desktop IDE only.

ExpandedHeight

Integer

Size of combobox when expanded.

FontBold

TRUE/FALSE

 

FontItalic

TRUE/FALSE

 

FontName

String

 

FontSize

Integer

 

FontStrikethru

true/FALSE

 

FontUnderline

true/FALSE

 

FontWeight

integer,
400 = normal 700 = bold

values greater than 550 are converted to 700 all others are converted to 400

ForeColor

Color (Integer)

Foreground color of object for text and drawing. Colors may be RGB values or the index of a color in the system palette.

Group

TRUE/false

Start a new option group.

OptionButton.

Height

Integer

Pixels from top edge to bottom edge of object

Hi Res Aware

True/False

If True, will take advantage of Hi Res devices.

HideSelection

TRUE/false

Causes the selected text to hide or show when the control has lost focus. TextBox

Hwnd

Long

Internal reference to object

Icon

Path

Icon for the app, in .ico format. Must contain 32x32 and 16x16 images.

IntegralHeight+

TRUE/FALSE

Constrain object to a height that is an integral multiple of individual line height. ComboBox, ListBox

Left

Integer

Pixels from left edge of output window to left edge of object

List(index†)

string

Array of values. Index argument required†

ListCount

Integer

Number of items in list. ComboBox, ListBox

ListIndex

Integer

Currently selected item. ComboBox, ListBox

Locked

true/FALSE

Enables or disables changes to text, while not affecting the ability to select text. TextBox

LongFormat

true/FALSE

format to display date. Date

LowercaseOnly

true/FALSE

Constrains text entered to only lowercase characters. ComboBox, TextBox

MaxLength

Integer
(0-30,000)

Number of characters allowed. TextBox (multiline)

MultiLine+

TRUE/FALSE

Enable embedded carriage returns and text wrapping. TextBox

MultiSelect

true/FALSE

Allows multiple items to be selected. ListBox

Name

 

The name of the object

NewIndex

Integer

Insertion index for for AddItem in unsorted list objects. ComboBox, ListBox

NumbersOnly

true/FALSE

Constrains text entered to only numeric characters. TextBox

ParentHWnd

Window Handle

The parent of an object

Password

true/FALSE

Hides text input, visually replacing all characters with an asterisk (*). TextBox

Redraw

TRUE/false

Enable or disable screen updates while adding multiple items to list. ComboBox, ListBox

Right

Integer

Obsolete – use Width

Scrollbars+

Integer
0 = No scroll bar
1 = Horizontal
2 = Vertical
3 = Both

ListBox (vertical only), TextBox (multiline)

SelCount

Integer

Read only. Returns the number of items selected. ListBox

Selected(index)

TRUE/FALSE

Runtime only. Set or check selection state of item index in the list. ListBox

SelLength

Integer

The number of characters selected.Textbox

SelStart

Integer

The first character selected. Textbox

SelText

String

The selected string. TextBox

Sorted+

TRUE/FALSE

Items added with AddItem are inserted alphabetically. ListBox, ComboBox

SpinBox+

TRUE/FALSE

If TRUE, will rotate values on one line. Listbox only.

Style+

Integer
0 = editable list
2 = read-only list

Input line is editable/read-only. ComboBox

Tabstop

TRUE/FALSE*

Allows object to activate to receive keyboard input by tabbing.

Tag

String

Available for your use

Text

String

Text displayed in object.

Timer

Long

Event object_timer fires after this number of milliseconds. 0 to disable.

Top

Integer

Pixels from top edge of output window to top edge of object

TopIndex

Integer

Get or set which item is displayed in the topmost position. ComboBox, ListBox

UppercaseOnly

true/FALSE

Constrains text entered to only uppercase characters. ComboBox, TextBox

UseMnemonic

TRUE/false

The underscore character can be added to window caption with an ampersand (&). Label

Value

TRUE/FALSE or 0/1

Object is checked or selected. CheckBox, OptionButton

Visible

TRUE/FALSE

Set with Hide/Show methods.

Width

Integer

Pixels from left edge to right edge of object

WindowLong(index)

Index:

0=ExWindowStyle

1=WindowStyle

See Microsoft Windows docs for SetWindowLong

               

†             read-only property. Set at design time only.

+             affects fundamental object display

*             default is FALSE for Label object

Example

REM Object Property Example

'A property is a variable in an object

ADDOBJECT "TextBox","Input"50,50,100,100

ADDOBJECT "CommandButton", "Button",150,  170,20,80

PRINT "Text: " & Button.Text

Button.Text = "Push Me!"

PRINT "Visible: " & CBOOL(Input.Visible)

Input.Hide

PRINT "Visible: " & CBOOL(Input.Visible)

Output

Text:

Visible: True

Visible: False

Related Items

Events, Methods