试试
在菜单的脚本里写
window win
win = create child_1
if find_sheet(win,parentwindow) = 1 then return
OpenSheet(child_1, MDI_User, 2, Original!)
把下面的代码存成find_sheet.srf
在库画笔里导入
$PBExportHeader$find_sheet.srf
$PBExportComments$打开Sheet窗口公用函数
global type find_sheet from function_object
end type
forward prototypes
global function integer find_sheet (window open_sheet, window mdi_window)
end prototypes
global function integer find_sheet (window open_sheet, window mdi_window);window win
string ls_opensheet_title
ls_opensheet_title = open_sheet.title
destroy open_sheet
win = mdi_window.getfirstsheet()
do while isvalid(win) // if we got a valid sheet
if win.title = ls_opensheet_title then return 1 // if the titles match then return true
win = mdi_window.getnextsheet(win) // get the next sheet
loop
return -1
end function