Hi, I am having a problem with using the Layout window in Mapinfo. I have a VB Application with a map window in it and I have a Print button which when pressed brings up a new form with the layout window in it all this is fine. But when I close the layout window and try to use some of the tools in the main window they do not work. The marquee tool does not work correctly because it is still trying to refer to the Layout window as opposed to the main window. I have tried setting the mapwindow as the front etc as illustrated in the following code numberwindows = goMapinfo.Eval("numwindows()") For x = 1 To numberwindows msg = "windowid( " & x & ")" winid = goMapinfo.Eval(msg) msg = "windowinfo( " & winid & "," & WIN_INFO_TYPE & ")" typeofwindow = goMapinfo.Eval(msg) If typeofwindow = 3 Then layoutid = winid ElseIf typeofwindow = 1 Then mapid = winid End If Next goMapinfo.Do "Close window " & layoutid Unload Me goMapinfo.Do "set window " & mapid & " front" goMapinfo.Do "set application window " & frmMain.picMap.hwnd This does not work however any suggestions would be greatly appreciated.
Thanks ******************************************************************** This message is intended only for the use of the person(s) ("the intended recipient(s)") to whom it is addressed. It may contain information which is privileged and confidential within the meaning of applicable law. If you are not the intended recipient, please contact the sender as soon as possible. The views expressed in this communication may not necessarily be the views held by LGCSB (Local Government Computer Services Board). Any attachments have been checked by a virus scanner and appear to be clean. Please ensure that you also scan all messages, as LGCSB does not accept any liability for contamination or damage to your systems. ********************************************************************