> For the complete documentation index, see [llms.txt](https://docs.wisej.com/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wisej.com/api/wisej.web/general/wisej.web.padding.md).

# Padding

Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (4.0.0.0)

Represents padding or margin information associated with a user interface (UI) element.

{% tabs %}
{% tab title="C#" %}

```csharp
public struct Padding : ValueType, IWisejSerializable
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Structure Padding
    Implements ValueType, IWisejSerializable
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/hsR4ok3152WyAf8J2C1u) Padding(left, top, right, bottom)

Initializes a new instance of the [Padding](/api/wisej.web/general/wisej.web.padding.md) class using a separate padding size for each edge.

| Name       | Type                                                        | Description                                       |
| ---------- | ----------------------------------------------------------- | ------------------------------------------------- |
| **left**   | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The padding size, in pixels, for the left edge.   |
| **top**    | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The padding size, in pixels, for the top edge.    |
| **right**  | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The padding size, in pixels, for the right edge.  |
| **bottom** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The padding size, in pixels, for the bottom edge. |

### ![](/files/hsR4ok3152WyAf8J2C1u) Padding(all)

Initializes a new instance of the [Padding](/api/wisej.web/general/wisej.web.padding.md) class using the supplied padding size for all edges.

| Name    | Type                                                        | Description                                                |
| ------- | ----------------------------------------------------------- | ---------------------------------------------------------- |
| **all** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The number of pixels to be used for padding for all edges. |

## Properties

### ![](/files/hsR4ok3152WyAf8J2C1u) All

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the padding value for all the edges.

### ![](/files/hsR4ok3152WyAf8J2C1u) Bottom

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the padding value for the bottom edge.

### ![](/files/hsR4ok3152WyAf8J2C1u) Horizontal

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns the combined padding for the right and left edges.

### ![](/files/hsR4ok3152WyAf8J2C1u) IsEmpty

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns if the padding is empty.

### ![](/files/hsR4ok3152WyAf8J2C1u) Left

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the padding value for the left edge.

### ![](/files/hsR4ok3152WyAf8J2C1u) Right

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the padding value for the right edge.

### ![](/files/hsR4ok3152WyAf8J2C1u) Size

[Size](https://docs.microsoft.com/dotnet/api/system.drawing.size): Returns the padding information in the form of a [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size).

### ![](/files/hsR4ok3152WyAf8J2C1u) Top

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the padding value for the top edge.

### ![](/files/hsR4ok3152WyAf8J2C1u) Vertical

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns the combined padding for the top and bottom edges.

## Methods

### ![](/files/lIX317sDtMTZJBi9oSIx) Add(p1, p2)

Computes the sum of the two specified [Padding](/api/wisej.web/general/wisej.web.padding.md) values.

| Parameter | Type                                                   | Description                                               |
| --------- | ------------------------------------------------------ | --------------------------------------------------------- |
| **p1**    | [Padding](/api/wisej.web/general/wisej.web.padding.md) | A [Padding](/api/wisej.web/general/wisej.web.padding.md). |
| **p2**    | [Padding](/api/wisej.web/general/wisej.web.padding.md) | A [Padding](/api/wisej.web/general/wisej.web.padding.md). |

**Returns:** [Padding](/api/wisej.web/general/wisej.web.padding.md). A [Padding](/api/wisej.web/general/wisej.web.padding.md) that contains the sum of the two specified [Padding](/api/wisej.web/general/wisej.web.padding.md) values.

### ![](/files/lIX317sDtMTZJBi9oSIx) Subtract(p1, p2)

Subtracts one specified [Padding](/api/wisej.web/general/wisej.web.padding.md) value from another.

| Parameter | Type                                                   | Description                                               |
| --------- | ------------------------------------------------------ | --------------------------------------------------------- |
| **p1**    | [Padding](/api/wisej.web/general/wisej.web.padding.md) | A [Padding](/api/wisej.web/general/wisej.web.padding.md). |
| **p2**    | [Padding](/api/wisej.web/general/wisej.web.padding.md) | A [Padding](/api/wisej.web/general/wisej.web.padding.md). |

**Returns:** [Padding](/api/wisej.web/general/wisej.web.padding.md). A [Padding](/api/wisej.web/general/wisej.web.padding.md) that contains the result of the subtraction of one specified [Padding](/api/wisej.web/general/wisej.web.padding.md) value from another.

## Used By

| Name                                                                                                                                          | Description                                                                                                                                                                                       |
| --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Control.Padding](/api/wisej.web/general/control.md#padding)                                                                                  | Returns or sets padding within the control.                                                                                                                                                       |
| [Control.Margin](/api/wisej.web/general/control.md#margin)                                                                                    | Returns or sets the space between controls.                                                                                                                                                       |
| [DataGridViewCellStyle.Padding](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle.md#padding)                       | Returns or sets the space between the edge of a [DataGridViewCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcell.md) and its content.                                    |
| [LabelWrapper.Padding](/api/wisej.web/editors/wisej.web.labelwrapper.md#padding)                                                              | Returns or sets the additional padding around the label. This property can be defined in the theme.                                                                                               |
| [UserPopup.Offset](/api/wisej.web/containers/wisej.web.userpopup.md#offset)                                                                   | Returns or sets the offset in pixels from the calculated position of the popup.                                                                                                                   |
| [ListView.ItemPadding](/api/wisej.web/lists-and-grids/listview.md#itempadding)                                                                | Returns or sets the padding inside [ListViewItem](/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem.md) objects in any [View](/api/wisej.web/lists-and-grids/listview.md#view) mode. |
| [StatusBarPanel.Padding](/api/wisej.web/containers/statusbar/wisej.web.statusbarpanel.md#padding)                                             | Returns or sets padding within the statusbar panel.                                                                                                                                               |
| [ToolBarButton.Padding](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md#padding)                                                 | Returns or sets padding within the toolbar button.                                                                                                                                                |
| [ToolBarButton.Margin](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md#margin)                                                   | Returns or sets the space between toolbar buttons.                                                                                                                                                |
| [Padding.Add](#add-p1-p2)                                                                                                                     | Computes the sum of the two specified [Padding](/api/wisej.web/general/wisej.web.padding.md) values.                                                                                              |
| [ControlExtensions.Padding](/api/wisej.web.markup/extensions/wisej.web.markup.controlextensions.md#padding-control-padding)                   | Sets the padding for the specified control.                                                                                                                                                       |
| [ControlExtensions.Margin](/api/wisej.web.markup/extensions/wisej.web.markup.controlextensions.md#margin-control-margin)                      | Sets the margin for the specified control using a [Padding](/api/wisej.web/general/wisej.web.padding.md) object.                                                                                  |
| [ToolBarButtonExtensions.Padding](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md#padding-toolbarbutton-padding) | Sets the padding of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).                                                                                            |
| [ToolBarButtonExtensions.Margin](/api/wisej.web.markup/extensions/wisej.web.markup.toolbarbuttonextensions.md#margin-toolbarbutton-margin)    | Sets the margin of the [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md).                                                                                             |
| [ClientTheme.GetInsets](/api/wisej.web/general/application/wisej.core.clienttheme.md#getinsets-appearance-state-includepadding)               | Returns the size of the inset border and padding.                                                                                                                                                 |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.web/general/wisej.web.padding.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
