//粘貼 private void tsbPaste_Click(object sender, EventArgs e) { IDataObject iData = Clipboard.GetDataObject(); if (iData.GetDataPresent(DataFormats.Text)) { txtContent.Text = (String)iData.GetData(DataFormats.Text); } } //復制 private void tsbCopy_Click(object sender, EventArgs e) { if (txtContent.Text != "") { Clipboard.SetDataObject(txtContent.Text); MessageBox.Show("已復制到剪貼板!"); } }