Form's StartPosition seems to be overridden when setting up multiple Responsive Profiles.

0
0

I have multiple forms used as modal windows and displayed by calling the ShowDialog method, all of which have their StartPosition propery set to CenterScreen. They were working fine until I set different Responsive Profiles for each one of those, none of them more complicated that just a little reshape of resize to fit the screen, but now they all appear at Location (25,25), even though I changed nothing from their properties. Could it be something related to the client profiles? is it unrelated? I also tried to relocate them on excecution time but it won’t let me unless I call Show(), which would allow for some undesired behaviour on the client side so I’d much prefer not to

  • You must to post comments
0
0

As a workaround, in case someone faces the same problem, I made a simple function that centers the form automatically and called it within the Load event handler

 

private void center()
{
this.Location = new System.Drawing.Point((Application.Browser.Size.Width – this.Width) / 2, (Application.Browser.Size.Height – this.Height) / 2);
}

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.