CONTROL POSITION CENTER ON FORM MAXIMIZE.

Samuel Fernandes

Total Post:159

Points:1117
Posted by  Samuel Fernandes
.NET 
 963  View(s)
Ratings:
Rate this:

Hi,

I am new to Windows Form application. I got into a very weird situation, I have created a Form where I have placed few controls to the center of the screen. Everything works fine when I execute the application, all control looks good and in center of the form where I had place.

Now, the issue comes when I maximize the form, control move to top left corner and not to the center of the form.

  1. ben reitman

    Post:96

    Points:676
    Re: Control position center on Form Maximize.

    Write code to change the position of the control at runtime on Resize event of the form.

  1. Mayank Tripathi

    Post:397

    Points:3117
    Re: Control position center on Form Maximize.

    By default every control has an Anchor property set to Left, Top that’s why your controls move to top left of the screen when maximize.

    Just change the Anchor property of the control to none. 

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!