.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Modeless Dialog display problem

3 REPLIES 3
Reply
Message 1 of 4
william.klawitter4MJ74
552 Views, 3 Replies

Modeless Dialog display problem

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

3 REPLIES 3
Message 2 of 4

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.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 4

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.

Message 4 of 4

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.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report