Open a page and put it in focus

Build 1501 on 14/Nov/2017  This topic last edited on: 6/Aug/2014, at 13:32

The Page.Focus or Designer.Focus command is not enough to put in focus a page you opened from a script.

For example, this code will put the page with id 8696 opened from the script, and draw on it a box, specified with the command Page.AddBoxEx(100000, 100000, 100000, 100000, 20):

    Fred.PageOpenId(8696, False, Designer.Group)

    TeraDP.GN4.WinUI.ShellWindow.DoEvents()

    Designer = TryCast(Designer.Group.SelectedDesigner, IPageDesigner)

    Designer.Focus()

    Page.Focus()

    Page.AddBoxEx(100000, 100000, 100000, 100000, 20)