mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-05-05 14:16:01 +02:00
- moved all files to a "source" subdirectory to tidy up the GitHub project page
- started to write a readme.md
This commit is contained in:
37
source/ChanSort/InfoBox.cs
Normal file
37
source/ChanSort/InfoBox.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
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)
|
||||
{
|
||||
if (string.IsNullOrEmpty(message))
|
||||
return;
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user