<!--
{
  "availability" : [
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWindow/setContentBorderThickness(_:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWindow(im)setContentBorderThickness:forEdge:"
  },
  "title" : "setContentBorderThickness(_:for:)"
}
-->

# setContentBorderThickness(_:for:)

Specifies the thickness of a given border of the window.

```
func setContentBorderThickness(_ thickness: CGFloat, for edge: NSRectEdge)
```

## Parameters

`thickness`

The thickness for `edge`, in points.

`edge`

The border whose thickness to set:

- `NSMaxYEdge`: Top border.
- `NSMinYEdge`: Bottom border.

## Discussion

In a nontextured window calling `setContentBorderThickness:forEdge:` passing `NSMaxYEdge` will raise an exception (in a nontextured window, it’s only valid to set the content border thickness of the bottom edge). It is only valid to set the content border thickness of the top edge in a textured window.

Typically, if you call `setContentBorderThickness:forEdge:`, you should also call `setAutorecalculatesContentBorderThickness:NO forEdge:`.

The `contentBorder` does not include the title bar or toolbar, so a textured window that just wants the gradient in the title bar and toolbar should have a `thickness` of `0` for `NSMaxYEdge`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)