Skip to content

WindowDeactivatedEventArgs.Window

property · WindowDeactivatedEventArgs · cAlgo.API

DesktopCLICloud

The window that got deactivated

Environment behaviour

CLI — not supported. Never raised in the CLI: the events that pass it never fire there (Window.Deactivated).

Cloud — not supported. Never raised in the cloud: the events that pass it never fire there (Window.Deactivated).

Definition

public Window Window {get;}
windowDeactivatedEventArgs.Window: Window

Returns Window

Examples

protected override void OnStart()
{
    var window = new Window { Title = "Trade Panel", Width = 300, Height = 200 };
    window.Deactivated += OnWindowDeactivated;
    window.Show();
}

private void OnWindowDeactivated(WindowDeactivatedEventArgs args)
{
    args.Window.Topmost = true;
    Print("Window is active: {0}, kept on top", args.Window.IsActive);
}
def on_start(self):
    window = Window()
    window.Title = "Trade Panel"
    window.Width = 300
    window.Height = 200
    window.Deactivated += self.on_window_deactivated
    window.Show()

def on_window_deactivated(self, args):
    args.Window.Topmost = True
    api.Print(f"Window is active: {args.Window.IsActive}, kept on top")