TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Visual DCL Programming => Topic started by: BazzaCAD on July 27, 2006, 08:22:26 PM

Title: VBA_Form_IsActive ?
Post by: BazzaCAD 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)
Title: Re: VBA_Form_IsActive ?
Post by: jbuzbee 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