Rectangle.FromLTRB Method
.NET Framework 4
Creates a Rectangle structure with the specified edge locations.
Assembly: System.Drawing (in System.Drawing.dll)
Parameters
- left
- Type: System.Int32
The x-coordinate of the upper-left corner of this Rectangle structure.
- top
- Type: System.Int32
The y-coordinate of the upper-left corner of this Rectangle structure.
- right
- Type: System.Int32
The x-coordinate of the lower-right corner of this Rectangle structure.
- bottom
- Type: System.Int32
The y-coordinate of the lower-right corner of this Rectangle structure.
The following code example demonstrates how to create a rectangle using the FromLTRB method. This example is designed to be used with a Windows Form. Paste this code into a form and call the CreateARectangleFromLTRB method when handling the form's Paint event, passing e as PaintEventArgs.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.