コード例 #1
0
ファイル: MagicTextLine.cs プロジェクト: Ju2ender/csharp-e
        private void ProcessReturnKey()
        {
            string LeftText = this.MyTextBox.Text.Substring(0, this.MyTextBox.CaretPosition);
            string RightText = this.MyTextBox.Text.Substring(this.MyTextBox.CaretPosition);
            this.MyTextBox.Text = LeftText;

            MagicTextLine newLine = new MagicTextLine(RightText);
            this.AppendBlocks(new Block[] { newLine });
            newLine.SetFocus();
        }
コード例 #2
0
        private void ProcessReturnKey()
        {
            string LeftText  = this.MyTextBox.Text.Substring(0, this.MyTextBox.CaretPosition);
            string RightText = this.MyTextBox.Text.Substring(this.MyTextBox.CaretPosition);

            this.MyTextBox.Text = LeftText;

            MagicTextLine newLine = new MagicTextLine(RightText);

            this.AppendBlocks(new Block[] { newLine });
            newLine.SetFocus();
        }
コード例 #3
0
        private void ProcessBackspace()
        {
            if (this.MyTextBox.CaretPosition != 0)
            {
                return;
            }

            string RightText = this.Text;

            MagicTextLine previous = this.Prev as MagicTextLine;

            if (previous != null)
            {
                int textLength = previous.Text.Length;
                previous.Text = previous.Text + RightText;
                previous.MyTextBox.CaretPosition = textLength;
                previous.SetFocus();
                this.Delete();
            }
        }