Hello,
I have a modeless dialog that upon a button click opens a drawing file via DocumentCollectionExtension.Open which returns a Document Object. (acCheckedOutDocument)
After that line I Hide the dialog so the user can work with the drawing they just opened.
I have Handled the BeginDocumentClose Event where I try to Show the dialog. I have tried numerous things however my dialog will not come to the forefront - it stays behind the AutoCAD Application window. Please Help.
Here is where the document is opened (you can see I have tried a few things here)
'Me.Visible = False
'Autodesk.AutoCAD.Internal.Utils.SetFocusToDwgView()
DocumentCollectionExtension.Open(Application.DocumentManager, CheckedOutDrawingFileName, False)
acCheckedOutDocument = Application.DocumentManager.MdiActiveDocument
'acCheckedOutDocument.Editor.StartUserInteraction(Me)
'Using acLock = acCheckedOutDocument.LockDocument
' Autodesk.AutoCAD.Internal.Utils.SetFocusToDwgView()
'End Using
Me.Hide()
Here is what I have tried in the BeginDocumentClose event.
Private Sub acCheckedOutDocument_BeginDocumentClose(sender As Object, e As DocumentBeginCloseEventArgs) Handles acCheckedOutDocument.BeginDocumentClose
'MsgBox("begin document close")
'Me.Visible = True
'Me.Activate()
'Me.BringToFront()
'Autodesk.AutoCAD.Internal.Utils.EnableFloatingWindows(True)
Me.Show()
Me.Activate()
'Application.ShowModelessDialog(vbNull, DrawingCatalog.JEDwgCatDrawingCatalogForm, True)
Me.BringToFront()
Me.CheckOutJeacButton.Focus()
Application.ShowModelessDialog(vbNull, DrawingCatalog.JEDwgCatDrawingCatalogForm, True)
acCheckedOutDocument = Nothing
End Sub
Hi,
You should use a user interface which inherits from PaletteSet instead of a modeless dialog (see this topic at TheSwamp).
Maybe you can get some inspiration from this discussion which shows how to play with the Visible property.
I solved the issue - I had to handle the document activated event since my app is MDI, when the drawing was close AutoCAD would activate the previous drawing in the document collection - hence making the autocad application window upfront once again.
Thanks for the reply - I may consider this however I have many hours into this app as is at this point. See my other post for my resolution.
Can't find what you're looking for? Ask the community or share your knowledge.