想要将一个尺寸为250,250的面板安装在另一个尺寸为881,593的面板中间 [英] would like to set a panel with a size of 250,250 to be fitted in the middle of an other panel with a size of 881,593
本文介绍了想要将一个尺寸为250,250的面板安装在另一个尺寸为881,593的面板中间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
我有一个小问题
我在名为panel1
的表单上获得了第一个面板
它是左,右,上,下的锚点
它的大小是881,593,位置是0,102
我在panel1上添加了另一个面板,现在称为panel2
我将其大小设置为250,250,我希望将panel2放在panel1的中间.
hey guys
i got a little problem
i got a first panel on a form which is called panel1
it is anchor to left,right,top,bottom
and it''s size is 881, 593 and it''s location is 0, 102
i add another panel on panel1 which is now called panel2
i set it size to 250,250 and i would like that panel2 to be fitted in the middle of panel1
推荐答案
所以:将顶部"和左侧"设置为:
So: set the Top and Left to:
Left = (WidthOuterPanel - WidthInnerPanel) / 2
Top = (HeightOuterPanel - HeightInnerPanel) / 2
这篇关于想要将一个尺寸为250,250的面板安装在另一个尺寸为881,593的面板中间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文