Sub Class_Globals
Private Root As B4XView 'ignore
Private xui As XUI 'ignore
Private B1 As Button
Private B2 As Button
Private B3 As Button
Private B4 As Button
Private B5 As Button
Private B6 As Button
Private B7 As Button
Private B8 As Button
Private B9 As Button
Private B10 As Button
End Sub
'You can add more parameters here.
Public Sub Initialize As Object
Return Me
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
'load the layout to Root
Root.LoadLayout("NewPage")
RearrangeView
End Sub
Sub RearrangeView
Dim BW As Long = 20%x ' Button Width
Dim BH As Long ' Button Height
BH = BW
' First Column
For Each C1B As Button In Array(B1, B2, B3, B4, B5)
C1B.Width = BW
C1B.Height = BH
C1B.Left = 10dip
Next
' Second Column
For Each C2B As Button In Array(B6, B7, B8, B9, B10)
C2B.Width = BW
C2B.Height = BH
C2B.Left = B1.Left + BW
Next
End Sub