leocb / MaterialSkin

Theming .NET WinForms, C# or VB.Net, to Google's Material Design Principles.
MIT License
438 stars 132 forks source link

Cant Start Form on Center Screen Position #243

Closed Dolefly closed 2 years ago

Dolefly commented 2 years ago

Hello again, I dont know how, but i cant force form to start on center screen position using; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; Seems to be overridden by this this.Location = new System.Drawing.Point(0, 0); and form is always started as far left corner! How can i go about it?

orapps44 commented 2 years ago

Hi,

That's right. I've checked commits history, and obviously bug has been introduced with PR #223.

VolatilePulse commented 2 years ago

I'm not sure what has caused this yet, but I'll add it to my to-do list.

orapps44 commented 2 years ago

Somehow, It seems to be related to following instruction in MaterialForm.cs :

MaximizedBounds = Screen.FromControl(this).WorkingArea;
Dolefly commented 2 years ago

Very true, this is culprit, after commenting out, am able to set form to center screen