子窗体进入父窗体范围内?

时间:2019-04-30 12:24:33

标签: c# winforms

我创建了自定义窗体,我为窗体创建了mdi子窗体。在最大化父窗体的同时,子窗体边界在父窗体内移动。我在OnWmNcCalcSize()方法及其以下代码中进行了尝试在屏幕上可以正常工作。但是在辅助显示器中,RC.left不能正常工作,因此我可以获得其他建议。enter image description here

                rc.top += fl.CaptionHeight;
                if (this.WindowState == FormWindowState.Maximized)
                {
                    ///<summary>
                    /// local variable to store x-coordinate of native rectangle,rc.left is -6 when we double click on title-bar and -8 when we click the maximize button.
                    /////</summary>
                    int xcoordinate = rc.left;
                    rc.left -= xcoordinate;
                    rc.right += xcoordinate;
                    rc.bottom += xcoordinate;
                }

0 个答案:

没有答案