简体   繁体   English

将另一个窗体放在此窗体上控件的顶部

[英]Place another form right on the top of a control on this form

In ac# windows form project, I have two separate forms. 在ac#Windows窗体项目中,我有两个单独的窗体。 One is called form A, which is a big one, with many controls on it. 一种叫做表格A,这是一个很大的表格,上面有很多控件。 The second is called B, having small size. 第二个称为B,具有较小的尺寸。 I want to relocate form B, so that it completely covers one of the specific controls inside form A. Simply enough, I could resize form B to match exactly the size of the control. 我想重新放置窗体B,以便它完全覆盖窗体A内的特定控件之一。很简单,我可以调整窗体B的大小以使其与控件的大小完全匹配。 But I couldn't find a way to position it properly. 但是我找不到正确定位的方法。 Any help? 有什么帮助吗?

Calculate the absolute position of the child control on form A based on the position of the form (A). 根据窗体(A)的位置计算窗体A上子控件的绝对位置。 Then set the absolute position of Form B based on the calculated value. 然后根据计算值设置表格B的绝对位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM