Microsoft Small Basic

Program Listing: MDP504-0
' TextBox Sample
' Version 0.2 - using TextTyped event
' Copyright © 2016 Nonki Takahashi. The MIT License.
' Program ID MDP504-0

GraphicsWindow.Title = "TB 0.2"
Init()

Sub Init
GraphicsWindow.Width = 220
GraphicsWindow.Height = 100
GraphicsWindow.BrushColor = "Black"
tbox = Controls.AddTextBox(10, 10)
shp = Shapes.AddText("")
Shapes.Move(shp, 10, 40)
Controls.TextTyped = OnTextTyped
EndSub

Sub OnTextTyped
txt = Controls.GetTextBoxText(tbox)
Shapes.SetText(shp, "Hello, " + txt + "!")
EndSub