2015-01-28 1 views
0

저는 Excel AddIns의 기본 사항을 잘 알고 있지만 내부 대화 상자를 디자인하고 구현하고 나중에 표시하는 방법을 모릅니다. Excel AddIn에서 사용할 대화 상자를 만드는 방법은 무엇입니까?

여기 이미지 질문 서 참조 :

https://social.msdn.microsoft.com/Forums/en-US/935ebeae-1b88-4609-ba33-b0e522d2797f/how-to-create-a-dialog-for-use-by-an-excel-addin?forum=exceldev

TIA

주 :

(1) 내 프로그래밍 언어 인 C#을

(2) 내가 디자인하는 것을 선호 대화 상자를 그려서

답변

2

당신은 예를 들어, 메시지 박스 클래스를 사용할 수 있습니다 :

const string message = 
    "Are you sure that you would like to close the form?"; 
const string caption = "Form Closing"; 
var result = MessageBox.Show(message, caption, 
          MessageBoxButtons.YesNo, 
          MessageBoxIcon.Question); 

// If the no button was pressed ... 
if (result == DialogResult.No) 
{ 
    // cancel the closure of the form. 
    e.Cancel = true; 
} 

자신에 대화 상자 창을 사용자 정의 할 경우, 프로젝트에 새 윈도우 폼을 추가 한 다음 필요한 컨트롤을 추가 할 수 있습니다. 코드에서 폼의 인스턴스를 만든 후 Show 또는 ShowDialog 메서드를 사용하여 폼의 인스턴스를 표시 할 수 있습니다.

관련 문제