public static void SetClipboardText(Control owner, string text) { try { ClipboardEx.Clear(); ClipboardEx.SetText(text); } catch (ExternalException) { MessageDlg.Show(FormUtil.FindTopLevelOwner(owner), GetCopyErrorMessage()); } }
/// <summary> /// Clears clipboard and copy a HTML fragment to the clipboard, providing additional meta-information. /// </summary> /// <param name="htmlFragment">a html fragment</param> /// <param name="title">optional title of the HTML document (can be null)</param> /// <param name="sourceUrl">optional Source URL of the HTML document, for resolving relative links (can be null)</param> /// <exception cref="ExternalException" /> public static void CopyToClipboard(string htmlFragment, string title, Uri sourceUrl) { ClipboardEx.SetText(ClipBoardText(htmlFragment, title, sourceUrl), TextDataFormat.Html); }