A simple example of c clipboard operation

  • 2020-05-24 06:02:14
  • OfStack


// Applied shear plate  
Clipboard.SetDataObject(textBox1.Text,true); 
// will textbox1 The text is placed in the clipped version  
// GetDataObject Retrieves the data on the current clipboard  
IDataObject iData = Clipboard.GetDataObject(); 
//  Matches the data to the specified format and returns bool 
if (iData.GetDataPresent(DataFormats.Text)) 
{ 
// GetData Retrieve the data and specify 1 A format  
textBox2.Text = (string)iData.GetData(DataFormats.Text); 
}  

Related articles: