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
-
objectWindowExtensions
Methods
AddShieldIcon(Button)
Adds a UAC shield icon to a button.
public static void AddShieldIcon(this Button button)
Parameters
buttonButton
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
windowWindow
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
windowWindow
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
windowWindow
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
windowWindowThe window to set the ID for.
appIDstringThe application ID to set.
relaunchCommandstringThe command to use for relaunching the application; can be
null.relaunchIconstringThe icon to use for relaunching the application; can be
null.relaunchNamestringThe name to display for relaunching the application; can be
null.
Remarks
Does nothing on platforms other than Windows 7 or newer.