Share via


Small Basic API: Controls Object

The Controls Object permits to add controls on a Window and raises events.

Edit

Controls.AddButton 

Controls.AddButton("caption",x,y)

The caption is the name of button. The x and y are the button coordinates on window. The button size is equal to caption size.

Controls.AddButton("Hello",40,20)

Edit

Controls.ButtonClicked 

A button is created to raise an event. This code is an example of button event. The Controls.ButtonClicked calls a sub to post a text in TextWindow. When we click in "Hello" button, "Hello World" is posted on TextWindow.

Controls.AddButton("Hello",40,20)
Controls.ButtonClicked=hello
Sub hello
  TextWindow.WriteLine("Hello World")
EndSub
Reference
This content originally came from the Small Basic Wiki.