.NET

Reply
Valued Contributor
rtejada
Posts: 61
Registered: ‎06-19-2002
Message 1 of 1 (77 Views)

Cancel Close command

77 Views, 0 Replies
04-12-2006 01:03 PM
Hi
I am looking to cancel the close command, I know what you are thinking, setting the variable Cancel to true on the Close event handler.
The problem is I need to cancel the close command right after it begins, the reason for it is to cancel a posible AutoCAD "Save" dialog. I need to replaced it by a customized version. This is what I have.

Private Sub AcadDoc_BeginCommand(ByVal CommandName As String) Handles AcadDoc.BeginCommand
If CommandName = "CLOSE" Then
If AcadDoc.Saved = False Then
'this is where I replaced the Save dialog box
Select Case msgbox ("My dialog box selections",MsgBoxStyle.YesNoCancel)
Case MsgBoxResult.Yes
AcadDoc.Save()
Case MsgBoxResult.No
'need to suppress the save here
Case Else´
'I attempt to do it with the instruction bellow, but it does not work
AcadDoc.SendCommand("(command)")

End Select

End If
End If
End If
End Sub


I will appreciate any help

Regards

Raul Tejada
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.