Modeless Dialog display problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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