如何实现剪切,复制,粘贴的功能????????
我做的一个小程序(WINFORM)里需要实现剪切,复制,粘贴的功能,不会啊!!!!而且一定要用到系统剪切版,随便从别的地方复制个东西,在我的小程序里都要能粘贴出来
哪位老大教教我???顺便说下,最好能把代码也发出来!!!!
谢谢拉
private void Form_Load(object sender, EventArgs e)
{ ContextMenu contextmenu1 = new ContextMenu(); MenuItem contextmenuItem1 = new MenuItem(); contextmenuItem1.Text = "剪切"; contextmenuItem1.Click += new System.EventHandler(contextmenuItem1_Click); MenuItem contextmenuItem2 = new MenuItem(); contextmenuItem2.Text = "复制"; contextmenuItem2.Click += new System.EventHandler(contextmenuItem2_Click); MenuItem contextmenuItem3 = new MenuItem(); contextmenuItem3.Text = "粘贴"; contextmenuItem3.Click += new System.EventHandler(contextmenuItem3_Click); contextmenu1.MenuItems.Add(contextmenuItem1); contextmenu1.MenuItems.Add(contextmenuItem2); contextmenu1.MenuItems.Add(contextmenuItem3); this.ContextMenu = contextmenu1; } private void contextmenuItem1_Click(object sender, System.EventArgs e) { MessageBox.Show(this, " ", "提示信息"); } private void contextmenuItem2_Click(object sender, System.EventArgs e) { MessageBox.Show(this, " ", "提示信息"); } private void contextmenuItem3_Click(object sender, System.EventArgs e) { MessageBox.Show(this, " ", "提示信息"); } } }