Table of Contents

Class WindowExtensions

Namespace
NanoByte.Common.EtoControls
Assembly
NanoByte.Common.EtoForms.dll

Provides extension methods for Eto.Forms.Windows and other Eto.Forms.Controls.

public static class WindowExtensions
Inheritance
object
WindowExtensions

Methods

AddShieldIcon(Button)

Adds a UAC shield icon to a button.

public static void AddShieldIcon(this Button button)

Parameters

button Button

Remarks

This is purely cosmetic. UAC elevation is a separate concern. Does nothing on platforms other than Windows Vista or newer or with Eto.Forms backends that do not use native Win32 buttons.

CenterOnScreen(Window)

Moves a window to the center of the screen it is on.

public static void CenterOnScreen(this Window window)

Parameters

window Window

Remarks

Can be called before the window is shown, e.g., from the Eto.Forms.Control.Load event handler.

CenterOnScreenIfOwnerless(Window)

Centers a window on the screen when it is loaded, unless it has an Eto.Forms.Window.Owner.

public static void CenterOnScreenIfOwnerless(this Window window)

Parameters

window Window

Remarks

Windows without an owner are otherwise placed at the top-left corner of the screen on some platforms.

PreventPinning(Window)

Prevents a window from being pinned to the Windows taskbar.

public static void PreventPinning(this Window window)

Parameters

window Window

Remarks

Does nothing on platforms other than Windows 7 or newer.

SetWindowAppID(Window, string, string?, string?, string?)

Sets the Application User Model ID for a window, controlling how it is grouped in the Windows taskbar.

public static void SetWindowAppID(this Window window, string appID, string? relaunchCommand = null, string? relaunchIcon = null, string? relaunchName = null)

Parameters

window Window

The window to set the ID for.

appID string

The application ID to set.

relaunchCommand string

The command to use for relaunching the application; can be null.

relaunchIcon string

The icon to use for relaunching the application; can be null.

relaunchName string

The name to display for relaunching the application; can be null.

Remarks

Does nothing on platforms other than Windows 7 or newer.