도움말 버튼을 감지하는 방법 Windows Forms MessageBox를 누릅니다.

StackOverflow https://stackoverflow.com/questions/2407880

  •  18-09-2019
  •  | 
  •  

문제

3 개의 버튼이있는 메시지 상자가 있습니다 : 예, 아니요, 도움말 :

var result = MessageBox.Show("text", "title",
                MessageBoxButtons.YesNo,
                MessageBoxIcon.Warning,
                MessageBoxDefaultButton.Button1,
                true);

예/아니오 버튼이 다음과 같은 클릭 한 경우를 감지 할 수 있습니다.

if(result == DialogResult.Yes)
    // some actions

도움말 버튼을 누르고 내 코드를 실행하는 방법은 무엇입니까?

도움이 되었습니까?

해결책

양식을 처리하고 싶습니다 HelpRequested 이벤트. 예제를 참조하십시오 도움말 주제.

public static DialogResult Show(
    string text,
    string caption,
    MessageBoxButtons buttons,
    MessageBoxIcon icon,
    MessageBoxDefaultButton defaultButton,
    MessageBoxOptions options,
    bool displayHelpButton
)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top