Sub Process_Globals
Private NumberOfLabels As Int = 7
Private labels(NumberOfLabels, NumberOfLabels) As Label
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.SetFormStyle("UTILITY")
MainForm.Show
For x = 0 To NumberOfLabels - 1
For y = 0 To NumberOfLabels - 1
Dim lb As Label
lb.Initialize("btn")
lb.Text = $"Label ${x}, ${y}"$
lb.Alignment = "CENTER"
labels(x, y) = lb
MainForm.RootPane.AddNode(lb, 0, 0, 10, 10)
Next
Next
End Sub
Private Sub MainForm_Resize (Width As Double, Height As Double)
Dim LblWidth As Double = (Width - 10)/ NumberOfLabels
Dim LblHeight As Double = (Height - 10)/ NumberOfLabels
For x = 0 To NumberOfLabels - 1
For y = 0 To NumberOfLabels - 1
labels(x, y).SetLayoutAnimated(0, 5 + x * LblWidth , 5 + y * LblHeight , LblWidth - 1, LblHeight - 1)
Next
Next
End Sub