Private Space As Int = 5dip
Private Width As Int = Min(100dip, (panLive_ListedUsers.Width - 5 * Space) / 4)
Private Height As Int = 30dip
Private posLeft As Int
Private i, j, k As Int
For i = 0 To 1
For j = 0 To 1
k = 2 * i + j
posLeft = Space
Private userCheckBox As CheckBox
userCheckBox.Initialize("userCheckBox")
userCheckBox.Tag = k
userCheckBox.Text = k + 1
panLive_ListedUsers.AddView(userCheckBox, posLeft + j * (Width + Space), Space + i * (Height + Space), Width, Height)
k = k + 4
posLeft = 3 * Space + 2 * Width
Private userCheckBox As CheckBox
userCheckBox.Initialize("userCheckBox")
userCheckBox.Tag = k
userCheckBox.Text = k + 1
panLive_ListedUsers.AddView(userCheckBox, posLeft + j * (Width + Space), Space + i * (Height + Space), Width, Height)
Next
Next