Dim pb As WinForm.Panel = Forms("菜单").Controls("Panel1")
Dim width As Integer = pb.width
Dim height As Integer = pb.height
Dim wh As Integer = width \ 105
Dim n As Integer = Tables("桌台信息").Rows.Count
Dim lbl As WinForm.panel
Dim lbl1 As WinForm.Label
Dim p As WinForm.PictureBox
Dim s, t As Integer
For i As Integer = 0 To n - 1
If i <> 0 Then
If i Mod wh = 0 Then
s = 0
t = t + lbl.Height + 10
Else
s = s +115
End If
End If
Dim r As Row = Tables("桌台信息").Rows(i)
Dim nm As String = r("序号")
Dim nm0 As String = r("桌台号")
lbl = Forms("菜单").CreateControl(nm, ControlTypeEnum.Panel)
lbl.name = nm
lbl.BackColor = Color.lightgray
lbl.Left = s
lbl.Top = t
lbl.Width = 105
lbl.Height = 90
Forms("菜单").Controls("panel1").AddControl(lbl)
lbl1 = Forms("菜单").CreateControl(nm0, ControlTypeEnum.Label)
lbl1.BackColor = Color.green
lbl1.ForeColor = Color.White
lbl1.Left = 0
lbl1.Top = 0
lbl1.Width = 105
lbl1.Height = 20
lbl1.Text = space(4) & nm0
lbl.AddControl(lbl1)
p = Forms("菜单").CreateControl(nm0, ControlTypeEnum.PictureBox)
p.name = nm0
p.Left = s
p.Top = t + 20
p.Width = 105
p.Height = 70
Forms("菜单").Controls("panel1").AddControl(p)