[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Margin.-ctor

Margin Constructor

Margin(int)

Creates a Margin instance that applies the same margin value to all four sides.

Use this constructor to define the watermark margin in pixels relative to a cell when the top, right, bottom, and left margins should be identical. The created margin can be applied through Margin.

Declaration
public Margin(int all)
Public Sub New(all As Integer)
Parameters
Type Name Description
int all

The value, in pixels, to set for all margins.

Examples
worksheet.Range["A1"].Value = "Draft";
Margin margin = new Margin(4);
worksheet.Range["A1"].LabelOptions.Margin = margin;

Margin(int, int, int, int)

Creates a margin with individual top, right, bottom, and left values.

Represents the watermark margin in pixels relative to the cell, with each side specified independently.

Declaration
public Margin(int top, int right, int bottom, int left)
Public Sub New(top As Integer, right As Integer, bottom As Integer, left As Integer)
Parameters
Type Name Description
int top

The top margin value, in pixels.

int right

The right margin value, in pixels.

int bottom

The bottom margin value, in pixels.

int left

The left margin value, in pixels.

Examples
Margin margin = new Margin(10, 20, 10, 20);
worksheet.Range["A1"].LabelOptions.Margin = margin;