カスタムダイアログを作成します。ここではあなたのアイデアを与えることができるものです:
public static class CheckboxDialog
{
public static bool ShowDialog(string text, string caption)
{
Form prompt = new Form();
prompt.Width = 180;
prompt.Height = 100;
prompt.Text = caption;
FlowLayoutPanel panel = new FlowLayoutPanel();
CheckBox chk = new CheckBox();
chk.Text = text;
Button ok = new Button() { Text = "Yes" };
ok.Click += (sender, e) => { prompt.Close(); };
Button no = new Button() { Text = "No" };
no.Click += (sender, e) => { prompt.Close(); };
panel.Controls.Add(chk);
panel.SetFlowBreak(chk, true);
panel.Controls.Add(ok);
panel.Controls.Add(no);
prompt.Controls.Add(panel);
prompt.ShowDialog();
return chk.Checked;
}
}
あなたはこの方法でそれを使用することができます。
bool overwrite = CheckboxDialog.ShowDialog("overwrite", "Overwrite location?");
カスタムダイアログを作成します。 –
うん、私は同意する。カスタムダイアログを使用する方法です。こちらも参照してください:http://social.msdn.microsoft.com/Forums/vstudio/en-US/2fa7e3e3-f55f-4c0d-bcf5-c7278af1d730/how-to-display-a-checkbox-in-message-box – rsbarro