using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
textBox1.Text = "谷子熟了,就低下了头;向日葵熟了,就低下了头。昂头是为了吸收正面的能量,低头是为了避免危险的冲撞,事实如此,正应了一句俗语:低头的是谷子,昂头的是秕子";
}
private void button1_Click(object sender, EventArgs e)
{
textBox1.Select(textBox1.SelectionStart, textBox1.SelectionLength);
textBox2.Text = textBox1.SelectedText;
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Select(textBox1.SelectionStart, textBox1.SelectionLength);
textBox2.Text = textBox1.SelectedText;
textBox1.Select(0,textBox1.SelectionStart-1);
textBox1.Text = textBox1.SelectedText;
}
private void button3_Click(object sender, EventArgs e)
{
textBox2.Undo();
}
}
}
文本复制、剪切、撤销
最新推荐文章于 2022-10-28 19:14:47 发布