ExceptionWindow erzeugt
This commit is contained in:
34
SanSystem/frmExceptionWindow.Designer.cs
generated
34
SanSystem/frmExceptionWindow.Designer.cs
generated
@@ -28,19 +28,51 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.txt_error = new System.Windows.Forms.TextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 16.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.button1.Location = new System.Drawing.Point(12, 389);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(911, 75);
|
||||
this.button1.TabIndex = 0;
|
||||
this.button1.Text = "OK";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.Button1_Click);
|
||||
//
|
||||
// txt_error
|
||||
//
|
||||
this.txt_error.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txt_error.Font = new System.Drawing.Font("Microsoft Sans Serif", 13.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.txt_error.Location = new System.Drawing.Point(12, 12);
|
||||
this.txt_error.Multiline = true;
|
||||
this.txt_error.Name = "txt_error";
|
||||
this.txt_error.Size = new System.Drawing.Size(911, 371);
|
||||
this.txt_error.TabIndex = 1;
|
||||
//
|
||||
// frmExceptionWindow
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.ClientSize = new System.Drawing.Size(935, 476);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.txt_error);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Name = "frmExceptionWindow";
|
||||
this.Text = "ExceptionWindow";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.TextBox txt_error;
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,25 @@ using System.Windows.Forms;
|
||||
|
||||
namespace SanSystem
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public partial class frmExceptionWindow : Form
|
||||
{
|
||||
public frmExceptionWindow()
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
public frmExceptionWindow(string message)
|
||||
{
|
||||
InitializeComponent();
|
||||
txt_error.Text = message;
|
||||
txt_error.ReadOnly = true;
|
||||
}
|
||||
|
||||
private void Button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,9 @@ namespace SanSystem
|
||||
}
|
||||
catch(DataBaseVersionMismatchException ex)
|
||||
{
|
||||
MessageBox.Show("Software und Datenbank passen nicht zusammen\nProgramm wird beendet\n"+ex.Message);
|
||||
Environment.Exit(0);
|
||||
frmExceptionWindow frmException = new frmExceptionWindow(ex.Message);
|
||||
frmException.FormClosed += FrmException_FormClosed;
|
||||
frmException.ShowDialog();
|
||||
}
|
||||
|
||||
//Datenbank.Instance.CreateProjekt("");
|
||||
@@ -68,8 +69,10 @@ namespace SanSystem
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void FrmException_FormClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
private void frm_main_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user