|
-
October 7th, 2002, 03:04 PM
#1
adding string to clipboard
Hi,
How can i add the contents of a string to windows clipboard?
Thanks.
-
October 7th, 2002, 03:09 PM
#2
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);
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|