WinForms button position - not aligned as it should
Posted
by Zka
on Stack Overflow
See other posts from Stack Overflow
or by Zka
Published on 2010-04-28T15:57:45Z
Indexed on
2010/04/28
16:03 UTC
Read the original article
Hit count: 504
Adding some gui modifications and I want to have a button which is 10pixels away from the forms left and right border. With this code the right border of the button is around 20-30 pixel outside the form window. Why is that? How can I position my button to be exactly 10pixels away from the form borders ?
int margin = 10;
meny1 = new Button();
meny1.Top = 50;
meny1.Left = margin;
meny1.Size = new Size(this.Width - (2*margin), 30);
© Stack Overflow or respective owner