/*
* FatalErrorDialog.cs
* Authors: August Zinsser
*
* Copyright Matthew Belmonte 2007
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace tAC_Engine
{
///
/// A standard windows form that displays a message
///
public partial class FatalErrorDialog : Form
{
public FatalErrorDialog()
{
InitializeComponent();
}
///
/// The message to display
///
public string Message { set { RebuildForm(value); } }
///
/// Resizes components on the form so they look nice
///
///
private void RebuildForm(string message)
{
lblMessage.Text = message;
this.Width = lblMessage.Width + 20;
butOK.Top = lblMessage.Height + 70;
butOK.Left = this.Width / 2 - butOK.Width / 2;
this.Height = butOK.Top + butOK.Height + 50;
this.CenterToScreen();
}
private void FatalErrorDialog_Load(object sender, EventArgs e)
{
this.AcceptButton = butOK;
}
private void butOK_Click(object sender, EventArgs e)
{
this.Close();
}
}
}