5行代碼 把cad窗體鑲?cè)氲阶砸训拇绑w 在VB的模塊中聲明api 如下:
Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long 隨便加一個窗體,在窗體代碼加入
Dim app As Object
Private Sub Form_Load() Set app = GetObject(, "Autocad.application") app.Visible = True SetParent app.hWnd, Form1.hWnd'重新設(shè)置cad窗體的父
End Sub
Private Sub Form_Unload(Cancel As Integer) SetParent app.hWnd, 0'關(guān)閉本窗體后要恢復(fù)來原來的,父為0即桌面
End Sub [ 本帖最后由 caiqs 于 2008-11-5 10:43 AM 編輯 ]
|
|