Skip to content

Window.Activated

event · Window · cAlgo.API

DesktopCLICloud

This event gets triggered when window is activated

Environment behaviour

CLI — not supported. Never shown: Show, Hide and Close send nothing; IsVisible stays false and window events never fire.

Cloud — not supported. Never shown: Show, Hide and Close send nothing; IsVisible stays false and window events never fire.

Definition

public event Action<WindowActivatedEventArgs> Activated;
window.Activated += handler  # handler(obj: WindowActivatedEventArgs)

Examples

var window = new Window { Title = "Order entry", Width = 300, Height = 200 };
window.Activated += args => Print("Window '{0}' activated", args.Window.Title);
window.Show();
def on_start(self):
    window = Window()
    window.Title = "Order entry"
    window.Activated += self.on_window_activated
    window.Show()

def on_window_activated(self, args):
    api.Print(f"Window '{args.Window.Title}' activated")