Files
ChanSort/source/ChanSort/InfoBox.cs

37 lines
888 B
C#
Raw Normal View History

2013-03-31 14:09:38 +02:00
using System.Windows.Forms;
using DevExpress.XtraEditors;
namespace ChanSort.Ui
{
public partial class InfoBox : XtraForm
{
public InfoBox()
{
InitializeComponent();
this.ActiveControl = this.simpleButton1;
}
public static void Show(IWin32Window owner, string message, string caption)
{
2013-05-07 12:20:38 +02:00
if (string.IsNullOrEmpty(message))
return;
2013-03-31 14:09:38 +02:00
var box = new InfoBox();
box.Text = caption;
box.txtMessage.Text = message;
box.txtMessage.Properties.ReadOnly = true;
box.txtMessage.SelectionStart = 0;
box.txtMessage.SelectionLength = 0;
box.ShowDialog(owner);
}
protected override bool ProcessDialogKey(Keys keyData)
{
if (keyData == Keys.Escape)
{
this.DialogResult = DialogResult.Cancel;
return true;
}
return base.ProcessDialogKey(keyData);
}
}
}