# PageMargins.Top Property

> Specifies the top margin of a TX Text Control document or document section. The measure depends on the TextControl.PageUnit, WPF.TextControl.PageUnit or ServerTextControl.PageUnit property.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Property
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl > PageMargins.Top Property
- **545 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/pagemargins/top-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/pagemargins/top-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/pagemargins/top-property/llms-full.txt

---

### Description

Specifies the top margin of a TX Text Control document or document section. The measure depends on the [TextControl.PageUnit](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/pageunit-property/llms-full.txt), [WPF.TextControl.PageUnit](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/pageunit-property/llms-full.txt) or [ServerTextControl.PageUnit](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/pageunit-property/llms-full.txt) property.

### Syntax

```csharp
public double Top { get; set; }
```

```vbnet
Public Property Top As Double
```

### Examples

The following example configures page margins for the current document by using `PageMargins.Top`.

```csharp
PageMargins pageMargins = textControl.PageMargins;

pageMargins.Top = 1.0;
Console.WriteLine($"Top used by Page Margins: {pageMargins.Top}");

pageMargins.Left = 1440;
pageMargins.Right = 1440;
```

```vbnet
Dim pageMargins As PageMargins = textControl.PageMargins

pageMargins.Top = 1.0
Console.WriteLine($"Top used by Page Margins: {pageMargins.Top}")

pageMargins.Left = 1440
pageMargins.Right = 1440
```

### Remarks

The margin's default value is 1 inch.

The property returns its default value when the text selection contains multiple sections with mixed margins. The [Selection.IsCommonValueSelected](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/selection/iscommonvalueselected-method/llms-full.txt) method can be used to check for mixed attributes.

---

## Nearby

- **Previous:** [PageMargins.Right Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/pagemargins/right-property/llms-full.txt)
- **Next:** [PageNumberField Class](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/pagenumberfield/llms-full.txt)
