50 lines
1.3 KiB
C#
50 lines
1.3 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
|
|
namespace AIProofread.Controls
|
|
{
|
|
public partial class FormDialog : Form
|
|
{
|
|
public FormDialog()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
|
|
private void SetMessage(string message)
|
|
{
|
|
LabelMeesage.Text = message;
|
|
}
|
|
private void SetButtonText(string yesButtonText, string noButtonText)
|
|
{
|
|
BtnClose.Text = noButtonText;
|
|
BtnConfirm.Text = yesButtonText;
|
|
}
|
|
|
|
public static DialogResult Show(string message, string caption, string yesButtonText, string noButtonText)
|
|
{
|
|
FormDialog formMessage = new FormDialog();
|
|
formMessage.SetMessage(message);
|
|
formMessage.Text = caption;
|
|
formMessage.SetButtonText(yesButtonText, noButtonText);
|
|
return formMessage.ShowDialog();
|
|
}
|
|
public static DialogResult Show(string message)
|
|
{
|
|
return Show(message, "", "是", "否");
|
|
}
|
|
|
|
private void BtnClose_Click(object sender, EventArgs e)
|
|
{
|
|
this.DialogResult = DialogResult.No;
|
|
this.Close();
|
|
}
|
|
|
|
private void button2_Click(object sender, EventArgs e)
|
|
{
|
|
this.DialogResult = DialogResult.Yes;
|
|
this.Close();
|
|
}
|
|
}
|
|
}
|