当前位置: 代码迷 >> PB >> 根据字符串窗口名,来关闭一个窗口解决思路
  详细解决方案

根据字符串窗口名,来关闭一个窗口解决思路

热度:251   发布时间:2016-04-29 10:37:22.0
根据字符串窗口名,来关闭一个窗口
知道一个窗口名,但它是字符串,怎样关闭这个的窗口。用close不行啊,它的参数是windowname类型。

------解决方案--------------------
简单一写,没有 测试

window activesheet,firstsheet
string mtext

firstsheet = w_frame.GetActiveSheet()
if not IsValid(activesheet) then return
activesheet = w_frame.GetActiveSheet()
do while IsValid(activesheet) THEN
if activesheet.Title = "xxxx " then
close(activesheet)
exit
end if
if activesheet =firstsheet then
exit
end if
activesheet = w_frame.GetNextSheet ( activesheet )
END IF
  相关解决方案