System.Windows.Forms.Clipboard.GetData C# (CSharp) Method

GetData() public static method

public static GetData ( string format ) : Object
format string
return Object
		public static Object GetData (string format)
		{
			IDataObject data = GetDataObject ();

			if (data == null)
				return null;

			return data.GetData (format, true);
		}

Usage Example

Example #1
0
        private void bt__Click(object sender, RoutedEventArgs e)
        {
            DataGrid dg = dgDocuments;

            dg.SelectAllCells();
            dg.ClipboardCopyMode = DataGridClipboardCopyMode.IncludeHeader;
            ApplicationCommands.Copy.Execute(null, dg);
            dg.UnselectAllCells();

            String result = (string)Clipboard.GetData(DataFormats.Text);

            string a, b;

            b = "@";

            a = (DBConnection.FolderZ.ToString());

            StreamWriter sw = new StreamWriter(a);

            sw.WriteLine(result);
            sw.Close();



            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.ShowDialog();
            File.WriteAllText(saveFileDialog.FileName, result);
        }
All Usage Examples Of System.Windows.Forms.Clipboard::GetData