Hello everybody,

I understand the difference between margins and padding in that a margin controls the external distances between elements on a form while padding is used to control the internal distances of a control's content.

Programmatically I am able to set a control's padding like this:

Code:
PictureBox myPictureBox = new PictureBox();
myPictureBox.Width = 100;
myPictureBox.Height = 100;

Padding myPadding = new Padding();
myPadding.All = 0; 

myPictureBox.Padding = myPadding;
The above code compiles, but I am having no luck in setting the margins in the same manner as the padding. If somebody could post an example I'd be grateful. Thank you.


Regards,


The Thing.