[]
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.
public Margin(int all)
Public Sub New(all As Integer)
| Type | Name | Description |
|---|---|---|
| int | all | The value, in pixels, to set for all margins. |
worksheet.Range["A1"].Value = "Draft";
Margin margin = new Margin(4);
worksheet.Range["A1"].LabelOptions.Margin = margin;
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.
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)
| 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. |
Margin margin = new Margin(10, 20, 10, 20);
worksheet.Range["A1"].LabelOptions.Margin = margin;