cim myControl as control
for each mycontrol in me.controls
debug.print mycontrol.top
next

解决方案 »

  1.   

    你在其他窗体的代码中加入判断语句应该可以吧
    或者就在你的主窗体的代码中直接引用其他窗体的控件名字,用完整的名称
    例如form3.command2如果是别人写的程序,那就不好判断位置了
      

  2.   

    Dim TempLng As Long
    Dim TempRect as RectTempLng=GetWindow(父窗体的hWnd, GW_CHILD)
    Do While TempLng
        GetWindowRect TempLng, TempRect
        '处理
        TempLng=GetWindow(TempRect,GW_HWNDNEXT)
    Loop
      

  3.   

    呵呵,解决了不是位置的事,是控件的GW_VISIBLE的事,原来是隐藏了呵呵……
    给分