Author Topic: VBA_Form_IsActive ?  (Read 6388 times)

0 Members and 1 Guest are viewing this topic.

BazzaCAD

  • Guest
VBA_Form_IsActive ?
« on: July 27, 2006, 08:22:26 PM »
How can you check if a VBA form is active or visible in Lisp?
Similar to (Odcl_Form_IsActive ODCLForm)

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: VBA_Form_IsActive ?
« Reply #1 on: July 28, 2006, 11:32:24 AM »
I don't know.

I'm assuming you have a modeless form and want to react to document changes or command actions?

What I do is have code like the following in the "ThisDrawing" class module:
Code: [Select]

'this is a "command reactor" that watches the view command

Private Sub AcadDocument_EndCommand(ByVal CommandName As String)
If CommandName Like "-VIEW" Then
Module1.ViewInit
End If
If CommandName Like "VIEW" Then
Module1.ViewInit
End If
End Sub


'This is like a change document reactor
Private Sub AcadDocument_Activate()
    Module1.ViewInit
    Module1.WSInit
    Module1.jbKeyNotesFormRefresh
    Module1.editLSInit
End Sub
I think Chad had to trap the error if the form wasn't active - a lisp thing.  I don't think VBA has that limitation.  The code above runs fine if the form is active or not.

Hope this helps:

jb
James Buzbee
Windows 8