hexagon logo

Want to catch push cancel button on execution window.

I want to catch push cancel button on execution window.

Because, part programs will be run more then 2 times on my program.

If I have some problems with measure, I will push cancel button on execution window.

When I use OnCloseExecutionDialog function, the program was exit everytime when dialog close.

I want to catch just push cancel button on execution dialog.

So, I use OnExecutionDialogButton function.

But it will show up message, everytime when I push button everything on execution dialog window.

How can I use that function ?

Please advise to me.

And please understand my short English skill.

Thank you everyone.





Public Sub OnExecutionDialogButton(ByVal ExecutionWindow As PCDLRN.ExecutionWindow, ByVal PushedBtnID As Long) Handles AppEvents.OnExecutionDialogButton
Dim Answ = MsgBox("프로램을 종료하겠습니까 ?", MsgBoxStyle.YesNo, Title:="Exit Program ?")

If Answ = MsgBoxResult.Yes Then

[INDENT=2]Exit Sub[/INDENT]
End If

End Sub
Parents
  • I would try using "OnEndExecution" like below: Note TerminationType == 2 for cancelling execution

    Private Sub AppEvents_OnEndExecution(ByVal PartProg As PCDLRN.IPartProgram, ByVal TerminationType As Long) ' Event subroutine. This activates when you END EXECUTION of the part program
    'put code here..
    End Sub
    
Reply
  • I would try using "OnEndExecution" like below: Note TerminationType == 2 for cancelling execution

    Private Sub AppEvents_OnEndExecution(ByVal PartProg As PCDLRN.IPartProgram, ByVal TerminationType As Long) ' Event subroutine. This activates when you END EXECUTION of the part program
    'put code here..
    End Sub
    
Children
No Data