PB中不打开重复窗体

// MDI程序选择打开窗体的菜单的clicked事件中:

Window w_sheet, lastsheet
// 找是否已经打开当前窗体的实例
w_sheet = ParentWindow.getfirstsheet()
IF IsValid(w_sheet) THEN
       do while true
              // messagebox('windows name', w_sheet.classname( ))
             
              if lower(w_sheet.classname()) = 'w_input' then  
                     w_sheet.setfocus()
                     w_sheet.windowstate = maximized!
                     w_sheet.setfocus()
                     return             // 找到,退出
              end if
             
              lastsheet = w_sheet
              w_sheet = parentwindow.getnextsheet(lastsheet)
             
              if not IsValid(w_sheet) then
                     exit
              end if
       loop
END IF
 
window www

opensheet(www, "w_input", ParentWindow)

// 非MDI程序
if   IsValid(w_1)   then  
Send(Handle(w_1),274,61728,0)
else
    Open(w_1)
end if

你可能感兴趣的:(windows,input)