Exemplo n.º 1
0
        // 貼り付け(メニュー)
        private void menuPaste_Click(object sender, EventArgs e)
        {
            String str = Clipboard.GetText();   // クリップボードから取得

            // 文字列を一つずつ貼り付けていく
            for (int i = 0; i < str.Length; ++i)
            {
                // 半角数字のみかどうか調べる
                if (MyDetection.IsHalfWidth(str.Substring(i, 1)) == true)
                {
                    // 最初のみ一度表示を消す
                    if (i == 0)
                    {
                        display = Common.CALC_FORMAT;
                    }

                    display = CalcManager.UpDigit(display, str.Substring(i, 1), ref beforInput, isDot);
                    display = CalcManager.ThousandSeparator(isSeparat, display);

                    resultTxt.Text = display;
                    this.Refresh();
                }
                else
                {
                    // 半角数字以外のものが見つかった場合は即終了
                    break;
                }
            }

            resultTxt.Text = display;
            this.Refresh();             // 表示を更新
        }