BackTerminal.frmCatNew.buttonOK_Click C# (CSharp) 메소드

buttonOK_Click() 개인적인 메소드

private buttonOK_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
리턴 void
        private void buttonOK_Click(object sender, EventArgs e)
        {
            if (textBox.Text.Length == 0)
            {
                MessageBox.Show("分类不能为空,请重新输入!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                this.DialogResult = DialogResult.None;
            }
            else if (textBox.Text.Length > 50)
            {
                MessageBox.Show("分类名的长度不能超过50",
                    "错误", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                this.DialogResult = DialogResult.None;
            }
            else result = textBox.Text;
        }