How To Open Windows Form In Center Screen In C# Windows Application

How To Open Windows Form In Center Screen In C# Windows Application

How To Open Windows Form In Center Screen In C# Windows Application

To achieve this select the form you want to start in the center screen then go to properties and set the Startposition property to CenterScreen.

How To Open Windows Form In Center Screen In C# Windows Application
How To Open Windows Form In Center Screen In C# Windows Application

It’s not advisable to call this directly in your source code, “Do not call this directly from your code. Instead, set the StartPosition property to CenterScreen. ” ( More Info ).

How To Open Windows Form In Center Screen - FormStartPosition
How To Open Windows Form In Center Screen – FormStartPosition

C# SOURCE CODE

        private void button8_Click(object sender, EventArgs e)
        {
            //Display Another Form On Button Click
            ViewSelectedDatagridviewRow showNewFormOnButtonClick = new ViewSelectedDatagridviewRow();
            //Start the form In the center screen
            showNewFormOnButtonClick.StartPosition = FormStartPosition.CenterScreen;
            showNewFormOnButtonClick.ShowDialog();
         }

Leave a Reply

Your email address will not be published. Required fields are marked *