Sub settingLayout(pn As Panel)
Dim xleft, xtop, xwidth, xheight, lwidth, lheigh, ldip, lmar
lmar = 0 ' margini dx e sx
lwidth = 480-lmar ' larghezza display
lheigh = 800-lmar ' altezza display
ldip = 160 ' risoluzione display
For i = 0 To pn.NumberOfViews-1
' calculate
xleft = pn.GetView(i).Left * lwidth / pn.Width
xtop = pn.GetView(i).Top * lheigh / pn.Height
xwidth = pn.GetView(i).Width * lwidth / pn.Width
xheight = pn.GetView(i).Height * lheigh / pn.Height
' setting object
pn.GetView(i).SetLayout(xleft,xtop,xwidth,xheight)
Next
End Sub