删除文本框里面被选中的文本 纠错
namespace 12{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
textBox1.Cut();
}
}
}
这样对吗? 如果不对正确的怎么写???
2010-04-18 12:54
if (textBox1.SelectedText != "")
textBox1.Text = textBox1.Text.Remove(textBox1.SelectionStart) +textBox1.Text.Substring(textBox1.SelectionLength +textBox1.SelectionStart);
2010-04-18 13:17
if (textBox1.SelectedText != "")
textBox1.Text = textBox1.Text.Replace(textBox1.SelectedText, "");这个方法更简单一点

2010-04-18 13:19
2010-04-18 14:31
2010-04-18 14:40
2010-04-18 15:15

2010-04-18 16:30
2010-04-18 18:07