InputInfo.cs 1.4 KB
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace App
{
    public partial class InputInfo : FrmBase
    {
        public MetroProduct mp;
        public InputInfo(MetroProduct mp)
        {
            this.SetLanguage(this);
            InitializeComponent();
            this.mp = mp;
        }

        private void saveButton_Click(object sender, EventArgs e)
        {
            saveProductName();
        }
        private void saveProductName()
        {
            mp.productName2 = this.textBox1.Text.ToString();
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
        private void cancelButton_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void InputInfo_Load(object sender, EventArgs e)
        {
            this.Text = getMsg("enterProductName");
            this.label1.Text = getMsg("productName");
            this.saveButton.Text = getMsg("FrmAdjustbtn_Save");
            this.cancelButton.Text = getMsg("FrmAdjustbtn_Cancel");
        }

        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)13)
            {
                saveProductName();
            }
        }
       
    }
}