using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace CarMeterSystem
{
    public partial class FrmMessage : Form
    {
        public FrmMessage()
        {
            InitializeComponent();
        }

        private string showMessage;//提示
        private string btnSaveText = "";//继续保存
        private string btnCancelText = "";//取消
        /// <summary>
        /// 提示信息
        /// </summary>
        public string ShowMessage
        {
            get { return showMessage; }
            set { showMessage = value; }
        }
        /// <summary>
        /// 确定按钮文字
        /// </summary>
        public string BtnSaveText
        {
            get { return btnSaveText; }
            set { btnSaveText = value; }
        }
        /// <summary>
        /// 取消按钮文字
        /// </summary>
        public string BtnCancelText
        {
            get { return btnCancelText; }
            set { btnCancelText = value; }
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            //btnSave.Enabled = true;
            //btnCancel.Enabled = true;
            btnSave.Enabled = false;
            btnCancel.Enabled = false;

        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }

        private void FrmMessage_Load(object sender, EventArgs e)
        {
            lblMessage.Text = showMessage;
            btnSave.Text = btnSaveText;
            btnCancel.Text = btnCancelText;
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }
    }
}
