Clipboard.GetDataObject() : Clipboard « System.Windows.Forms « C# / C Sharp by API






Clipboard.GetDataObject()

 

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Windows.Forms;
public class MainClass {


    public static void Main(string[] args) {

        IDataObject iData = Clipboard.GetDataObject();

        if (iData.GetDataPresent(DataFormats.Text)) {
            Console.WriteLine((String)iData.GetData(DataFormats.Text));
        }
        if (iData.GetDataPresent(DataFormats.Bitmap)) {
            Image img = (Bitmap)iData.GetData(DataFormats.Bitmap);

        }
    }
}

   
  








Related examples in the same category

1.Clipboard.SetDataObject