Button按钮实现 向左或向右 缩进字符并显示在首部(尾部)(技术改变世界-cnblog)

一个小案例,菜鸟的学习,高手 看个热闹,新手鼓励交流

  
        private void button2_Click(object sender, EventArgs e)//实现按钮向左缩进字符然后现在是尾部
        {
            string str = textBox1.Text;
            textBox1.Text = str.Substring(1, str.Length - 1) + str[0];


            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string str = textBox1.Text;
            textBox1.Text = str[str.Length-1] + str.Substring(0, str.Length-1); //实现按钮向后缩进字符然后显示在首部
        }
string str = textBox1.Text;
textBox1.Text = str.Substring(str.Length-1,1) + str.Substring(0, str.Length-1); //实现按钮向后缩进字符然后显示在首部
}



posted @ 2012-01-13 22:45  Anleb  阅读(1329)  评论(0编辑  收藏  举报