COPY AND PASTE THE DATA USING CLIPBOARD

Labels:

//copy the data using Clipboard

Clipboard.SetDataObject(textBox1.SelectedText,true);

//paste the data using Clipboard

IDataObject iData = Clipboard.GetDataObject();

//Determine whether the data is in a format you can use.

if(iData.GetDataPresent(DataFormats.Text))
{
textBox1.SelectedText =(String)iData.GetData(DataFormats.Text); //display it in a text box.
}

0 comments:

Post a Comment