winform程序之按键逐字向左和向右移动(简单)

winform程序之按键逐字向左和向右移动(简单)_第1张图片

按上图简单布局,实现按向左按钮,文字向左逐字移动,反之按向右按钮,文字则向右移动的功能

右按钮事件:

<textarea cols="50" rows="15" name="code" class="c-sharp:showcolumns"> textBox1.Text = textBox1.Text[textBox1.Text.Length - 1] + textBox1.Text.Substring(0, textBox1.Text.Length - 1); </textarea>

左按钮事件:

<textarea cols="50" rows="15" name="code" class="c-sharp:showcolumns"> textBox1.Text = textBox1.Text.Substring(1) + textBox1.Text[0]; </textarea>

你可能感兴趣的:(winform程序之按键逐字向左和向右移动(简单))