다이어그램에서 Shape 을 삭제할 때 확인을 하도록 하는 방법은 다음과 같다.

 

C#

 

// NDrawingDocument 의 OnNodeRemoving 이벤트를 구독:
nDrawingDocument1.EventSinkService.NodeRemoving += new ChildNodeCancelEventHandler(EventSinkService_NodeRemoving);
  
// 이벤트 핸들러 작성:
void EventSinkService_NodeRemoving(NChildNodeCancelEventArgs args)
{
    if(MessageBox.Show("Remove ?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question) !=
        DialogResult.Yes)
    {
        args.Cancel = true;
    }
} 

 

VB.NET

' NDrawingDocument 의 OnNodeRemoving 이벤트를 구독:
AddHandler NDrawingDocument1.EventSinkService.NodeRemoving, AddressOf EventSinkService_NodeRemoving
   
' 이벤트 핸들러 작성:
Private Sub EventSinkService_NodeRemoving(args As NChildNodeCancelEventArgs)
    If MessageBox.Show("Remove ?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question) <> DialogResult.Yes Then
        args.Cancel = True
    End If
End Sub 

 

 

위 내용은 아래 페이지를 옮겼습니다.

How to ask a user for confirmation when he or she deletes a diagram shape?

 

 

행복한 고수되십시요.

 

woojja ))*

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

반응형

'ETC > Nevron' 카테고리의 다른 글

[ETC-Nevron] Database 를 이용하여 다이어그램을 자동생성  (0) 2017.04.05

+ Recent posts