There is No PaddingF
There is Point and PointF, Size and SizeF, Rectangle and RectangleF, Padding and… wait, there is no PaddingF!
System.Drawing vs. System.Windows.Forms
The 2-D drawing functions in the System.Drawing namespace accept both integer and floating point measurements. That’s why the main 2-D drawing structures have both int and float versions such as Point and PointF, respectively.
However, the Padding structure is defined separately in the System.Windows.Forms namespace where most 2-D measurements are in integers. Hence, there is an integer Padding structure but no floating point PaddingF.
Left, Top, Right, Bottom
Another oddity about Padding is the default order of the measurements. In standard HTML CSS, padding is defined in this order: Top, Right, Bottom, Left. For example:
padding:25px 50px 75px 100px;
- top padding is 25px
- right padding is 50px
- bottom padding is 75px
- left padding is 100px
However in .NET, the Padding constructor arguments are defined in this order: Left, Top, Right, Bottom:
public Padding( int left, int top, int right, int bottom )
For more information about Padding, be sure to check out this other C#411 article:
Is it that odd? Windows rectangles have been defined by the order (left, top, right, bottom) since WIN16 days:-
http://msdn.microsoft.com/en-us/library/dd162897(VS.85).aspx
The .Net Rectangle class is defined by the uppper -left corner along with the width and height which naturally leads you to (left, top, ?, ?) if you want consistency within the API.