If dgvstall.RowCount > 0 Then
For i As Integer = 0 To x
Dim Panel As New Panel
Dim xloc As String = dgvstall.Rows(i).Cells(2).Value
Dim yloc As String = dgvstall.Rows(i).Cells(3).Value
Dim xsize As String = dgvstall.Rows(i).Cells(4).Value
Dim ysize As String = dgvstall.Rows(i).Cells(5).Value
Panel.BackColor = System.Drawing.Color.Black
Panel.Location = New Point(xloc, yloc)
Panel.Size = New Point(xsize, ysize)
Me.Controls.Add(Panel)
Next
End If
我要实现的是根据行数创建一组面板,然后设置名称,大小和位置