Share via


Small Basic Reference Documentation: Controls Object

Small Basic: Reference Documentation > Controls
 


 
http://smallbasic.com/img/object_32.png

Controls

The Controls object allows you to add, move and interact with controls.

Properties

http://smallbasic.com/img/property_16.png LastClickedButton (This property is read-only.)

Controls.LastClickedButton

Gets the last Button that was clicked on the Graphics Window.

http://smallbasic.com/img/property_16.png LastTypedTextBox (This property is read-only.)

Controls.LastTypedTextBox

Gets the last TextBox, text was typed into.

Events

http://smallbasic.com/img/event_16.png ButtonClicked

Controls.ButtonClicked

Raises an event when any button control is clicked.

http://smallbasic.com/img/event_16.png TextTyped

Controls.TextTyped

Raises an event when text is typed into any TextBox control.

Operations

http://smallbasic.com/img/method_16.png AddButton

Controls.AddButton(caption, left, top)

Adds a button to the graphics window with the specified position.

caption

The caption to display in the button.

left

The x co-ordinate of the button.

top

The y co-ordinate of the button.

Returns

The button that was just added to the Graphics Window.

http://smallbasic.com/img/method_16.png GetButtonCaption

Controls.GetButtonCaption(buttonName)

Gets the current caption of the specified button.

buttonName

The Button whose caption is requested.

Returns

The current caption of the button.

http://smallbasic.com/img/method_16.png SetButtonCaption

Controls.SetButtonCaption(buttonName, caption)

Sets the caption of the specified button.

buttonName

The Button whose caption needs to be set.

caption

The new caption for the button.

Returns

Nothing

http://smallbasic.com/img/method_16.png AddTextBox

Controls.AddTextBox(left, top)

Adds a text input box to the graphics window with the specified position.

left

The x co-ordinate of the text box.

top

The y co-ordinate of the text box.

Returns

The text box that was just added to the Graphics Window.

http://smallbasic.com/img/method_16.png AddMultiLineTextBox

Controls.AddMultiLineTextBox(left, top)

Adds a multi-line text input box to the graphics window with the specified position.

left

The x co-ordinate of the text box.

top

The y co-ordinate of the text box.

Returns

The text box that was just added to the Graphics Window.

http://smallbasic.com/img/method_16.png GetTextBoxText

Controls.GetTextBoxText(textBoxName)

Gets the curent text of the specified TextBox.

textBoxName

The TextBox whose text is requested.

Returns

The text in the TextBox

http://smallbasic.com/img/method_16.png SetTextBoxText

Controls.SetTextBoxText(textBoxName, text)

Sets the text of the specified TextBox.

textBoxName

The TextBox whose text needs to be set.

text

The new text for the TextBox.

Returns

Nothing

http://smallbasic.com/img/method_16.png Remove

Controls.Remove(controlName)

Removes a control from the Graphics Window.

controlName

The name of the control that needs to be removed.

Returns

Nothing

http://smallbasic.com/img/method_16.png Move

Controls.Move(control, x, y)

Moves the control with the specified name to a new position.

control

The name of the control to move.

x

The x co-ordinate of the new position.

y

The y co-ordinate of the new position.

Returns

Nothing

http://smallbasic.com/img/method_16.png SetSize

Controls.SetSize(control, width, height)

Sets the size of the control.

control

The name of the control to be resized.

width

The width of the control.

height

The height of the control.

Returns

Nothing

http://smallbasic.com/img/method_16.png HideControl

Controls.HideControl(controlName)

Hides an already added control.

controlName

The name of the control.

Returns

Nothing

http://smallbasic.com/img/method_16.png ShowControl

Controls.ShowControl(controlName)

Shows a previously hidden control.

controlName

The name of the control.

Returns

Nothing

 

See Also

Other Languages