private void TextBox2_TextChanged(object sender, EventArgs e)
 {
     CheckLetters.CheckValue(itemType, textBox2.Text, false);
     //((StatementBlock)this.Parent).CheckName(textBox1.Text, Name, false);
 }
        public override string CodeOutput(int level)
        {
            string Quotation = "";


            String levelString = new string('\t', level);

            CheckLetters.CheckName(textBox1.Text, true);
            if (NameList.Contains(textBox1.Text))
            {
                Form1.MessageBoxValue("同じ名前の変数が既にあります", true);
            }
            else
            {
                NameList.Add(textBox1.Text);
                if (string.IsNullOrWhiteSpace(textBox1.Text))
                {
                    Form1.MessageBoxValue("変数の名前が入力されていません", true);
                }
            }
            switch (comboBox1.SelectedIndex)
            {
            case -1:
                Form1.MessageBoxValue("変数の型が選択されていません", true);
                break;

            case 0:
                itemType = "int";
                break;

            case 1:
                itemType = "string";
                break;

            case 2:
                itemType = "char";
                break;

            case 3:
                itemType = "double";
                break;

            case 4:
                itemType = "byte";
                break;

            case 5:
                itemType = "bool";
                break;
            }
            if (checkBox1.Checked == true)
            {
                if (String.IsNullOrWhiteSpace(textBox2.Text) == false)
                {
                    if (itemType == "char")
                    {
                        char a;
                        if (char.TryParse(textBox2.Text, out a))
                        {
                            Quotation = "\'";
                        }
                        else
                        {
                            Form1.MessageBoxValue("型にあっていません", true);
                        }
                        if (string.IsNullOrWhiteSpace(textBox1.Text))
                        {
                            Form1.MessageBoxValue("入力されていないところがあります", true);
                        }
                    }
                    else if (itemType == "string")
                    {
                        Quotation = "\"";
                    }
                    CheckLetters.CheckValue(itemType, textBox2.Text, true);
                    return(levelString + itemType + " " + this.textBox1.Text + " = " + Quotation + textBox2.Text + Quotation + ";\r\n");
                }
                else
                {
                    if (itemType != "string")
                    {
                        Form1.MessageBoxValue("変数に代入する値が入力されていません", true);
                    }
                    else
                    {
                        return(levelString + itemType + " " + this.textBox1.Text + " = " + "\"\"" + ";\r\n");
                    }
                }
            }


            return(levelString + itemType + " " + this.textBox1.Text + ";\r\n");
        }