你好,尼克,
不是很确定,但在VB中,您可以关闭窗体并将其隐藏
这里有一个类模块调用一个模块,然后模块调用表单,然后表单隐藏,然后表单卸载。如果不卸载表单,它仍将在mem中加载
- Option Explicit
- 'this allows the AcadApplication to be accessable from the form
- Public AcadApp2 As AcadApplication
类模块
- Public Sub SLW1(AcadApp As AcadApplication)
-
- SLWal1c AcadApp
- End Sub
模块
- Public Sub SLWal1c(AcadApp As AcadApplication)
- Set AutoCAD_Application = AcadApp
- Set thisdrawing = AutoCAD_Application.ActiveDocument
- Set AcadApp2 = AcadApp
- frmW1.Show vbModal
- End Sub
表单现在向用户开放,并显示
表单
- Private Sub cmdGO_Click()
- Set AutoCAD_Application = AcadApp2
- Set thisdrawing = AutoCAD_Application.ActiveDocument
- frmW1.Hide 'form hidden here
- msgbox "You form is hidden, but still loaded"
- msgbox "Now to unload the form..."
- Unload Me
- End Sub
您可能需要做类似的事情<祝你好运,戴夫 |