private void 全选ToolStripMenuItem_Click(object sender, EventArgs e)
{
txtText.SelectAll();
if (txtText.SelectedText != "")
{
this.复制ToolStripMenuItem.Enabled = true;
this.剪切ToolStripMenuItem.Enabled = true;
this.删除MenuItem4.Enabled = true;
}
else
{
this.复制ToolStripMenuItem.Enabled = false;
this.剪切ToolStripMenuItem.Enabled = false;
this.删除MenuItem4.Enabled = false;
}
}
private void toolStripButton8_Click(object sender, EventArgs e)
{
this.删除MenuItem4_Click(sender, e);
}
private void 删除MenuItem4_Click(object sender, EventArgs e)
{
txtText.SelectedText = "";
}
private void txtText_Click(object sender, EventArgs e)
{
if (txtText.SelectedText != "")
{
this.复制ToolStripMenuItem.Enabled = true;
this.剪切ToolStripMenuItem.Enabled = true;
this.删除MenuItem4.Enabled = true;
}
else
{
this.复制ToolStripMenuItem.Enabled = false;
this.剪切ToolStripMenuItem.Enabled = false;
this.删除MenuItem4.Enabled = false;
}
} |