Hi,
How can i add the contents of a string to windows clipboard?
Thanks.
Printable View
Hi,
How can i add the contents of a string to windows clipboard?
Thanks.
nevermind... it's easy There is a Clipboard clas in Windows.Forms.
from c-sharpcorner.com:
private void CutCopyData()
{
Clipboard.SetDataObject(textBox1.SelectedText);
}
private void PasteData()
{
IDataObject iData = Clipboard.GetDataObject();
//Determine whether the data is in a format you can use.
if(iData.GetDataPresent(DataFormats.Text))
{
string str = (String)iData.GetData(DataFormats.Text);
}
}