inputbox.cs

来自「Arg BestFirstSearch with game demo you c」· CS 代码 · 共 57 行

CS
57
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace NIM
{
    public partial class InputBox : Form
    {
        public int value = -1;

        public InputBox()
        {
            InitializeComponent();
        }       

        private void InputBox_Load(object sender, EventArgs e)
        {
            //this.Visible = true;
        }

        public void setMessage(string message)
        {
            lblMessage.Text = message;
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            value = Convert.ToInt16(txtValue.Text);
            this.Dispose();
            //this.Visible = false;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Dispose();
            //this.Visible = false;
        }

        private void txtValue_TextChanged(object sender, EventArgs e)
        {
           
        }

        private void txtValue_KeyPress(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            if (e.KeyData == Keys.Enter)
            {
                MessageBox.Show("dada");
                btnOK_Click(sender, e);
            }
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?