Show a child form in the centre of Parent form in C#
Try:
loginForm.StartPosition = FormStartPosition.CenterParent;
loginForm.ShowDialog(this);
Of course the child form will now be a blocking form (dialog) of the parent window, if that isn't desired then just replace ShowDialog
with Show
..
loginForm.Show(this);
You will still need to specify the StartPosition though.
Trouble Getting Child Form to Center to Maximized Parent
You can get the parent form in the child form, and set the parent location to the child and then center it.
Location = parentForm.Location;
CenterToScreen();
You can send the parent form in the constructor.
new PasswordCheckForm(this);
Related Topics
Measure a String Without Using a Graphics Object
Hot Unload/Reload of a Dll Used by an Application
.Net and Bitmap Not Automatically Disposed by Gc When There Is No Memory Left
How to "Zip" or "Rotate" a Variable Number of Lists
Filter All Queries (Trying to Achieve Soft Delete)
Calculate the Display Width of a String in C#
How to Keep Console Window Open
C#: Multiline Text in Datagridview Control
Any Reason to Use Auto-Implemented Properties Over Manual Implemented Properties
System.Web.Httpcontext.Current.User.Identity.Name VS System.Environment.Username in ASP.NET
How to Save Picturebox.Image to File
Wait Some Seconds Without Blocking UI Execution