窗口代码:Private Sub CommandButton1_Click()
Me.Hide
ThisDrawing.Judge = True
End Sub
Thisdrawing代码:
Public Judge As Boolean
Private Sub AcadDocument_BeginRightClick(ByVal PickPoint As Variant)
If Judge Then
Judge = False
UserForm1.Show
End If
End Sub
效果:单击CommandButton1隐藏
在运行操作后点右键显示
不过右键操作太频繁,可以考虑改为双击事件控制