# Javascript: PageBorder.setTopLineColor Method

> Sets the color of the top border line.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 26.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: PageBorder.setTopLineColor Method
- **360 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/pageborder/settoplinecolor-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/pageborder/settoplinecolor-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/pageborder/settoplinecolor-method/llms-full.txt

---

### Description

Sets the color of the top border line.

### Syntax

```javascript
<void> PageBorder.setTopLineColor(<string> topLineColor, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| topLineColor | The color of the top border line. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `PageBorder.setTopLineColor` in a practical document-editing workflow. It sets the color of the top border line.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

function configureTopLineColor(pageBorder) {
    pageBorder.setTopLineColor(
        "#ffd54f",
        function() {
            console.log("set top line color completed.");
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: PageBorder.setTopDistance Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/pageborder/settopdistance-method/llms-full.txt)
- **Next:** [Javascript: PageBorder.setTopLineWidth Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/pageborder/settoplinewidth-method/llms-full.txt)
