# GH_WindowsFormUtil class

Namespace: [Grasshopper.GUI](https://developer.rhino3d.com/api/gh1/namespace/grasshopper.gui.md) · Assembly: [Grasshopper](https://developer.rhino3d.com/api/gh1/assembly/grasshopper.md)

```cs
public sealed class GH_WindowsFormUtil
```

Exposes some static (Shared) utility functions for positioning custom windows.

## Methods

- [CenterFormOnCursor](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gh-windowsformutil/centerformoncursor.md): (2 overloads, static) Positions a Form so that it is centered around the cursor
- [CenterFormOnEditor](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gh-windowsformutil/centerformoneditor.md): (2 overloads, static) Positions a Form so that it is centered on the active editor. If the editor doesn't exist or is hidden, the form will be centered on the screen instead.
- [CenterFormOnScreen](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gh-windowsformutil/centerformonscreen.md): (2 overloads, static) Positions a Form so that it is centered on the current screen. The current screen being defined as the screen containing the cursor.
- [CenterFormOnWindow](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.gh-windowsformutil/centerformonwindow.md): (2 overloads, static) Positions a Form so that it is centered on the supplied window. If the window doesn't exist or is hidden, the form will be centered on the screen instead.
