Class GridMargins
This is an immutable object that provides storage for top, left bottom and right margins in a cell.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public class GridMargins : ICloneable
Remarks
This is different from GridMarginsInfo. This is a stand-alone class that does not implement any inheritance mechanism. It simply holds the specified values.
Constructors
GridMargins()
Initializes a new instance of the GridMargins class.
Declaration
public GridMargins()
GridMargins(Int32, Int32, Int32, Int32)
Initializes a new instance of the GridMargins class with the specified left, right, top, and bottom margins.
Declaration
public GridMargins(int left, int top, int right, int bottom)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | left | The left margin. |
System.Int32 | top | The top margin. |
System.Int32 | right | The right margin. |
System.Int32 | bottom | The bottom margin. |
Properties
Bottom
Gets the bottom margin.
Declaration
public int Bottom { get; }
Property Value
Type |
---|
System.Int32 |
Height
Gets the total of the top and bottom margin.
Declaration
public int Height { get; }
Property Value
Type |
---|
System.Int32 |
Info
Gets results of ToString method.
Declaration
public string Info { get; }
Property Value
Type |
---|
System.String |
Left
Gets the left margin.
Declaration
public int Left { get; }
Property Value
Type |
---|
System.Int32 |
Right
Gets the right margin.
Declaration
public int Right { get; }
Property Value
Type |
---|
System.Int32 |
Top
Gets the top margin.
Declaration
public int Top { get; }
Property Value
Type |
---|
System.Int32 |
Width
Gets the total of the left and right margin.
Declaration
public int Width { get; }
Property Value
Type |
---|
System.Int32 |
Methods
AddMargins(Rectangle, GridMargins)
Adds margins to a given System.Drawing.Rectangle
Declaration
public static Rectangle AddMargins(Rectangle bounds, GridMargins margins)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Rectangle | bounds | The original System.Drawing.Rectangle. |
GridMargins | margins | The GridMargins to be added. |
Returns
Type | Description |
---|---|
System.Drawing.Rectangle | The resulting System.Drawing.Rectangle. |
AddMargins(Size, GridMargins)
Adds margins to a given System.Drawing.Size
Declaration
public static Size AddMargins(Size size, GridMargins margins)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Size | size | The original System.Drawing.Size. |
GridMargins | margins | The GridMargins to be added. |
Returns
Type | Description |
---|---|
System.Drawing.Size | The resulting System.Drawing.Size. |
Clone()
Retrieves a duplicate of this object, member by member.
Declaration
public virtual object Clone()
Returns
Type | Description |
---|---|
System.Object | A duplicate of this object. |
Equals(Object)
Determines if the specified object and the current object are equal.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | An object to compare. |
Returns
Type | Description |
---|---|
System.Boolean | True if they are equal; False otherwise. |
Overrides
GetHashCode()
Serves as a hash function for a particular type.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | Hash code. |
Overrides
RemoveMargins(Rectangle, GridMargins)
Removes margins from a given System.Drawing.Rectangle
Declaration
public static Rectangle RemoveMargins(Rectangle bounds, GridMargins margins)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Rectangle | bounds | The original System.Drawing.Rectangle. |
GridMargins | margins | The GridMargins to be removed. |
Returns
Type | Description |
---|---|
System.Drawing.Rectangle | The resulting System.Drawing.Rectangle. |
RemoveMargins(Size, GridMargins)
Removes margins from a given System.Drawing.Size.
Declaration
public static Size RemoveMargins(Size size, GridMargins margins)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Size | size | The original System.Drawing.Size. |
GridMargins | margins | The GridMargins to be removed. |
Returns
Type | Description |
---|---|
System.Drawing.Size | The resulting System.Drawing.Size. |
SwapRightToLeft()
Swaps right and left margins.
Declaration
public GridMargins SwapRightToLeft()
Returns
Type | Description |
---|---|
GridMargins | A copy of this object with right and left margins swapped. |
ToString()
Returns a string holding the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | String representation of the current object. |