窗口中table控件,只有在窗口打开的时候,才会在Tables集合中。
有可能有的窗口没有打开,从而没有设置到 tb.ListMode = True
你要把代码 tb.ListMode = True 设置到每个窗口的afterload中去