In my WinForms application, I have a main form, which may or may not be
visible depending on the user's wishes. This main form initiates a separate
thread that starts a data transfer process.
In this thread I want to show a special dialog box. Because the question
must be answered, I'm using ShowDialog to display it. Just before doing so,
I have some simple code to:
- Center it in the main form, if that form is visible
- Center it in the screen otherwise
Yet to my amazement, this centering code (ie. Left & Top) has absolutely no
effect. Why not?
I even hardcoded in a new location but it had no effect either. Here's the
code in question:
frmInstallPrompt frmInstall = new frmInstallPrompt();
frmInstall.DisplayMobileDeviceInfo();
//frmInstall.CenterForm(parentForm, parentForm.WindowState);
frmInstall.Location = new System.Drawing.Point(1000, 1000);
DialogResult retval = frmInstall.ShowDialog();
--
Robert W.
Vancouver, BC
www.mwtech.com