# View.GetUpdateRectangle Method

> Returns the coordinates of the smallest rectangle that completely encloses the update region. When the document's visible part changes, a Changed event occurs and the changed part is added to the view's update region. The bValidate parameter can be used to reset the current update region to an empty rectangle. When the document's visible part changes because the document has been scrolled, the Changed event informs about the changed part, but it is not added to the update region.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 24.0
- **Namespace:** `TXTextControl.ServerVisualisation`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Server.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.Server.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Server.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.ServerVisualization > View.GetUpdateRectangle Method
- **859 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/view/getupdaterectangle-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/view/getupdaterectangle-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/view/getupdaterectangle-method/llms-full.txt

---

### Description

Returns the coordinates of the smallest rectangle that completely encloses the update region. When the document's visible part changes, a [Changed](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/view/changed-event/llms-full.txt) event occurs and the changed part is added to the view's update region. The bValidate parameter can be used to reset the current update region to an empty rectangle. When the document's visible part changes because the document has been scrolled, the [Changed](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/view/changed-event/llms-full.txt) event informs about the changed part, but it is not added to the update region.

### Syntax

#### GetUpdateRectangle(bool)

Returns the coordinates of the smallest rectangle that completely encloses the update region. When the document's visible part changes, a [Changed](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/view/changed-event/llms-full.txt) event occurs and the changed part is added to the view's update region. The bValidate parameter can be used to reset the current update region to an empty rectangle. When the document's visible part changes because the document has been scrolled, the [Changed](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/view/changed-event/llms-full.txt) event informs about the changed part, but it is not added to the update region.

```csharp
public Rectangle GetUpdateRectangle(bool bValidate);
```

```vbnet
Public Function GetUpdateRectangle(bValidate As Boolean) As Rectangle
```

| Parameter | Description |
|---|---|
| bValidate | Validates the current update region and resets it to an empty rectangle. |

#### GetUpdateRectangle(bool, out int, out int)

```csharp
public Rectangle GetUpdateRectangle(bool bValidate, out int iFirstInvalidLine, out int iLastInvalidLine);
```

```vbnet
Public Function GetUpdateRectangle(bValidate As Boolean, ByRef iFirstInvalidLine As Integer, ByRef iLastInvalidLine As Integer) As Rectangle
```

### Return Value

The return value specifies the smallest rectangle that completely encloses the current update region.

### Examples

The following example retrieves update rectangle from the view.

```csharp
var result = view.GetUpdateRectangle(true);
Console.WriteLine($"Get Update Rectangle result: {result}");
```

```vbnet
Dim result = view.GetUpdateRectangle(True)
Console.WriteLine($"Get Update Rectangle result: {result}")
```

---

## Nearby

- **Previous:** [View.GetImage Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/view/getimage-method/llms-full.txt)
- **Next:** [View.Location Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/view/location-property/llms-full.txt)
