I try to create login page, i want to center dinamically horizontally and vertically a container in a page, even if I resize it.
My container (groupbox):
Thanks in advance
Just put it into the center on the page in the designer and change the anchor of the groupbox to none.
Write this on Load and ResponsiveProfileChanged events in the page:
// code for initializing the panel and setting // its size goes here _thePanel.Location = new Point( this.ClientSize.Width / 2 - _thePanel.Size.Width / 2, this.ClientSize.Height / 2 - _thePanel.Size.Height / 2); _thePanel.Anchor = AnchorStyles.None;Regards
Please login first to submit.