You can dynamically connect PowerBuilder events or functions to a .NET event of a third-party control using PowerScript.
There are two ways to make the connection: using Delegate += or .NET AddHandler function.
First, declare a PowerBuilder event or function with parameters that are the same as the .NET event.
event MyDockWindowClosing(object sender, RoutedEventArgs e) { CancelSourceRoutedEventArgs cancelArg = e; cancelArg.Cancel = true; mle_1.text += e.OriginalSource; }
or
function wf_DockWindowClosing(object sender, RoutedEventArgs e) { CancelSourceRoutedEventArgs cancelArg = e; cancelArg.Cancel = true; mle_1.text += e.OriginalSource; }
dockWindow.Closing += MyDockWindowClosing
or
dockWindow.Closing += wf_DockWindowClosing
System.Windows.RoutedEventHandler reh reh = this.wf_DockWindowClosing //or reh = this.MyDockWindowClosing System.Windows.RoutedEvent re re = DevComponents.WpfDock.DockWindow.ClosingEvent w_frame.InnerControl.AddHandler(re, reh)