Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("1") 'Load the layout file.
MainForm.Show
Label1.Text = MakeItVertical("我家没有电脑。我家也没有冰箱。", 5)
End Sub
Sub MakeItVertical(s As String, NumberOfLettersPerColumn As Int) As String
Dim NumberOfColumns As Int = Ceil(s.Length / NumberOfLettersPerColumn)
Dim sb As StringBuilder
sb.Initialize
For y = 0 To NumberOfLettersPerColumn - 1
For x = 0 To NumberOfColumns - 1
Dim Index As Int = (NumberOfColumns - 1 - x) * NumberOfLettersPerColumn + y
If Index < s.Length Then
sb.Append(s.CharAt(Index))
Else
sb.Append(" ")
End If
Next
sb.Append(CRLF)
Next
Return sb.ToString
End Sub