Windows 8 clipboard Application

Source: Internet
Author: User
Clipboard Application Program The example demonstrates how to use commands such as copy, paste, cut, and move. This example uses the windows. ApplicationModel class. Datatransfer namespace. Some classes, you may want to discuss in detail the clipboard class, which accesses the clipboard, datapackage class, you can use it to pack content before joining to the clipboard. This example includes the following: • How to copy and paste text • how to copy and paste an image • how to copy and paste a file • How To Get A format on the clipboard • how to detect changes to the clipboard learn more about using the clipboard, we recommend that you take a look at our guidelines and checklists for clipboard commands and our Quick Start: clipboard basic theme async Void Scenario1pastebutton_click ( Object Sender, routedeventargs E)
{
Scenario1outputtext. Text = " Content in the clipboard: " ;
Datapackageview = clipboard. getcontent ();

If (Datapackageview. Contains (standarddataformats. Text ))
{
Scenario1outputtext. Text = " Text: " + Environment. newline + await datapackageview. gettextasync ();
}
Else
{
Scenario1outputtext. Text = " Text: " + Environment. newline + " No text format on clipboard " ;
}

If (Datapackageview. Contains (standarddataformats. html ))
{
String Htmlformat = await datapackageview. gethtmlformatasync ();
String Htmlfragment = htmlformathelper. getstaticfragment (htmlformat );
Scenario1outputhtml. navigatetostring ( " HTML: <br/> " + Htmlfragment );
}
Else
{
Scenario1outputhtml. navigatetostring ( " HTML: <br/> no html format on clipboard " );
}

}

Complete example:/files/risk/windows8/clipboard application sample.rar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.