Controls on the form to maintain the same relative position

To maintain the same relative position, such as a button on the form, I hope when the form size changes, the button on the form and always maintain the relative position will not change. Draw as a button in the center of the screen, maximized or minimized in the form of time remains a central button on the screen. You need to set the button's properties

        Anchor property and are provided Dock property. Anchor property value set None, only to ensure that none Dock property value in the center of the screen window.

    private void Form1_Load(object sender, EventArgs e)
    {
        button1.Anchor = AnchorStyles.None;
    }

Guess you like

Origin www.cnblogs.com/zhujie-com/p/12348233.html