在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
private void 复制ToolStripMenuItem_Click(object sender, EventArgs e)
{ this.contextMenuStrip1.SourceControl.Select();//先获取焦点,防止点两下才运行 RichTextBox rtb = (RichTextBox)this.contextMenuStrip1.SourceControl; rtb.Copy(); } private void 粘贴ToolStripMenuItem_Click(object sender, EventArgs e) { this.contextMenuStrip1.SourceControl.Select(); RichTextBox rtb = (RichTextBox)this.contextMenuStrip1.SourceControl; rtb.Paste(); } private void 剪切ToolStripMenuItem_Click(object sender, EventArgs e) { this.contextMenuStrip1.SourceControl.Select(); RichTextBox rtb = (RichTextBox)this.contextMenuStrip1.SourceControl; rtb.Cut(); } private void 删除ToolStripMenuItem_Click(object sender, EventArgs e) { this.contextMenuStrip1.SourceControl.Select(); RichTextBox rtb = (RichTextBox)this.contextMenuStrip1.SourceControl; rtb.SelectedText = ""; } private void 全选ToolStripMenuItem_Click(object sender, EventArgs e) { this.contextMenuStrip1.SourceControl.Select(); RichTextBox rtb = (RichTextBox)this.contextMenuStrip1.SourceControl; rtb.SelectAll(); } private void 撤销ToolStripMenuItem_Click(object sender, EventArgs e) { this.contextMenuStrip1.SourceControl.Select(); RichTextBox rtb = (RichTextBox)this.contextMenuStrip1.SourceControl; rtb.Undo(); } |
请发表评论