Here are the examples of the csharp api class System.Windows.Forms.Clipboard.Clear() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
106 Examples
0
0
2. Example
View licenseprivate void CopyToolStripMenuItem_Click( object sender, System.EventArgs e ) { if( m_lvData.SelectedItems.Count > 0 ) { Utils.CopyToClipboard( m_lvData.SelectedItems[0], false ); } else { Clipboard.Clear(); } }
0
3. Example
View licenseprivate void CopyToolStripMenuItem_Click (object sender, System.EventArgs e) { if (m_lvData.SelectedItems.Count > 0) { Utils.CopyToClipboard(m_lvData.SelectedItems[0], false); } else { Clipboard.Clear(); } }
0
4. Example
View licenseprivate void CopyToolStripMenuItem_Click (object sender, System.EventArgs e) { if (m_listView.SelectedItems.Count > 0) { Utils.CopyToClipboard(m_listView.SelectedItems[0], true); } else { Clipboard.Clear(); } }
0
5. Example
View licenseprivate void CopyToolStripMenuItem_Click (object sender, EventArgs e) { if (m_lvData.SelectedItems.Count > 0) { Utils.CopyToClipboard(m_lvData.SelectedItems[0], false); } else { Clipboard.Clear(); } }
0
6. Example
View licenseprivate void CopyToolStripMenuItem_Click (object sender, EventArgs e) { if (m_lvData.SelectedItems.Count > 0) { Utils.CopyToClipboard(m_lvData.SelectedItems[0], false); } else { Clipboard.Clear(); } }
0
0
0
9. Example
View licenseprivate void ClipBoardClearThread() { Clipboard.Clear(); statusPB.Visible = false; statusTxt.Text = Strings.Ready; statusPB.Value = 0; btnMakeVisible.Visible = true; txtPassDetail.Visible = false; }
0
10. Example
View licenseprivate void clearClipboardToolStripMenuItem_Click(object sender, EventArgs e) { Clipboard.Clear(); }
0
11. Example
View licensepublic static void ClearClipboard() { System.Windows.Forms.Clipboard.Clear(); }
0
12. Example
View licenseprivate void clearClipboardMenuItem_Click(object sender, EventArgs e) { Clipboard.Clear(); }
0
13. Example
View licenseprivate void clearClipboardMenuItem_Click_1(Object sender, EventArgs e) { Clipboard.Clear(); }
0
14. Example
View licenseprivate void clearClipboardToolStripMenuItem_Click(object sender, EventArgs e) { Clipboard.Clear(); }
0
15. Example
View licenseprivate void copyChunkToolStripMenuItem_Click(object sender, EventArgs e) { Clipboard.Clear(); var chunks = listView.SelectedObjects.Cast<CR2WChunk>().ToList(); CopyController.ChunkList = chunks; pasteChunkToolStripMenuItem.Enabled = true; }
0
16. Example
View licenseprivate void mnuMainClearClipboard_Click(object sender, EventArgs e) { //clear copied files in clipboard if (GlobalSetting.StringClipboard.Count > 0) { GlobalSetting.StringClipboard = new StringCollection(); Clipboard.Clear(); DisplayTextMessage(GlobalSetting.LangPack.Items["frmMain._ClearClipboard"], 1000); } }
0
17. Example
View licensevoid copyMenuItem_Click(object sender, EventArgs e) { ToolStripMenuItem menuItem = (ToolStripMenuItem)sender; ListView parent = (ListView)menuItem.Tag; int columnIndex = -1; for (int i = 0; i < parent.Columns.Count; i++) { if (parent.Columns[i].Text == menuItem.Text) { columnIndex = i; continue; } } if (columnIndex == -1) return; if (parent.SelectedItems.Count != 1) return; if (columnIndex < parent.SelectedItems[0].SubItems.Count) Clipboard.SetText(parent.SelectedItems[0].SubItems[columnIndex].Text); else Clipboard.Clear(); }
0
18. Example
View licensepublic static void CopyToClipboard(ListViewItem lvItem, Boolean multipleItems) { if (lvItem.SubItems.Count > 1) { if (!multipleItems) { Clipboard.SetDataObject(lvItem.SubItems[1].Text); } else { Clipboard.SetDataObject(lvItem.SubItems[0].Text + " => " + lvItem.SubItems[1].Text); } } else { Clipboard.Clear(); } }
0
19. Example
View licenseprivate void copyIPToolStripMenuItem_Click(object sender, EventArgs e) { Clipboard.Clear(); Clipboard.SetText(ip, TextDataFormat.Text); }
0
20. Example
View licensepublic void CopyToClipboard() { Clipboard.Clear(); Clipboard.SetText(Source); }
0
21. Example
View licenseprivate static void CopySelectedItem(PackageSource selectedPackageSource) { Clipboard.Clear(); Clipboard.SetText(selectedPackageSource.Source); }
0
22. Example
View licensepublic void copyToClipboardMenuButton_Click(object sender, EventArgs e) { System.Windows.Forms.Clipboard.Clear(); string copyString = ""; if (SelectedObject.Count > 0) { foreach (IWorldObject obj in SelectedObject) { copyString += obj.ObjectAsString; } System.Windows.Forms.Clipboard.SetText(copyString); } }
0
23. Example
View licenseprivate void hideButton_Click(object sender, EventArgs e) { Keys mask = Keys.Shift | Keys.Control; if ((Control.ModifierKeys & mask) == mask) { Clipboard.Clear(); Clipboard.SetText(settings.Settings); } Visible = false; }
0
24. Example
View licenseprivate void hideButton_Click(object sender, EventArgs e) { Keys mask = Keys.Shift | Keys.Control; if ((Control.ModifierKeys & mask) == mask) { Clipboard.Clear(); Clipboard.SetText(settings.Settings); } Visible = false; }
0
25. Example
View licenseprivate void copyButton_Click(object sender, EventArgs e) { Clipboard.Clear(); Clipboard.SetImage(picture.Image); }
0
26. Example
View licenseprivate void copyTrackerToolStripMenuItem_Click(object sender, EventArgs e) { string trackers = ""; lock (lstTrackerInfo.Items) { foreach (ListViewItem item in lstTrackerInfo.SelectedItems) { TrackerClient tracker = item.Tag as TrackerClient; if (tracker != null) trackers += tracker.TrackerUri.AbsoluteUri + "\r\n"; } } if (trackers != "") { try { Clipboard.Clear(); Clipboard.SetText(trackers); } catch { } } }
0
27. Example
View licenseprivate void copyAllTrackersToolStripMenuItem_Click(object sender, EventArgs e) { string trackers = ""; lock (lstTrackerInfo.Items) { foreach (ListViewItem item in lstTrackerInfo.Items) { TrackerClient tracker = item.Tag as TrackerClient; if (tracker != null) trackers += tracker.TrackerUri.AbsoluteUri + "\r\n"; } } if (trackers != "") { try { Clipboard.Clear(); Clipboard.SetText(trackers); } catch { } } }
0
28. Example
View licenseprivate void mnuCopy_Click(object sender, EventArgs e) { try { Clipboard.Clear(); Clipboard.SetText(labName.Text); } catch { } }
0
29. Example
View licenseprivate void mnuCopy_Click(object sender, EventArgs e) { Label label = mnuCopyUtility.Tag as Label; if (label != null) { try { Clipboard.Clear(); Clipboard.SetText(label.Text); } catch { } } }
0
30. Example
View licenseprivate void copyTrackerToolStripMenuItem_Click(object sender, EventArgs e) { string trackers = ""; lock (lstTrackerInfo.Items) { foreach (ListViewItem item in lstTrackerInfo.SelectedItems) { TrackerClient tracker = item.Tag as TrackerClient; if (tracker != null) trackers += tracker.TrackerUri.AbsoluteUri + "\r\n"; } } if (trackers != "") { try { Clipboard.Clear(); Clipboard.SetText(trackers); } catch { } } }
0
31. Example
View licenseprivate void copyAllTrackersToolStripMenuItem_Click(object sender, EventArgs e) { string trackers = ""; lock (lstTrackerInfo.Items) { foreach (ListViewItem item in lstTrackerInfo.Items) { TrackerClient tracker = item.Tag as TrackerClient; if (tracker != null) trackers += tracker.TrackerUri.AbsoluteUri + "\r\n"; } } if (trackers != "") { try { Clipboard.Clear(); Clipboard.SetText(trackers); } catch { } } }
0
32. Example
View licenseprivate void mnuCopy_Click(object sender, EventArgs e) { try { Clipboard.Clear(); Clipboard.SetText(labName.Text); } catch { } }
0
33. Example
View licenseprivate void mnuCopy_Click(object sender, EventArgs e) { Label label = mnuCopyUtility.Tag as Label; if (label != null) { try { Clipboard.Clear(); Clipboard.SetText(label.Text); } catch { } } }
0
34. Example
View licenseprivate static void CopySelectedItem(PackageSource selectedPackageSource) { Clipboard.Clear(); Clipboard.SetText(selectedPackageSource.Source); }
0
35. Example
View licensepublic void CopyToClipBoard() { if (String.IsNullOrEmpty(_textContent.Text)) { Clipboard.Clear(); return; } Clipboard.SetText(_textContent.Text); return; }
0
36. Example
View licensepublic void CopyToClipBoard() { if (String.IsNullOrEmpty(_textContent.Text)) { Clipboard.Clear(); return; } Clipboard.SetText(_textContent.Text); return; }
0
37. Example
View licensepublic void CopyToClipBoard() { if (String.IsNullOrEmpty(_textContent.Text)) { Clipboard.Clear(); return; } Clipboard.SetText(_textContent.Text); return; }
0
38. Example
View licenseprivate void copyToolStripMenuItem_Click(object sender, EventArgs e) { try { Clipboard.Clear(); Clipboard.SetImage(imageBox.GetSelectedImage() ?? imageBox.Image); } catch (Exception ex) { MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
0
39. Example
View licensepublic IRange ToExcel(object target = null, bool autoDispose = true) { IRange range = ExcelExt.GetRange(target); Clipboard.SetDataObject(_bitmap, false); range.Worksheet.Paste(range, _bitmap); Clipboard.Clear(); if (autoDispose) _bitmap.Dispose(); return range; }
0
40. Example
View licensepublic static void CopyToClipboard(string htmlFragment, string title, Uri sourceUri) { var dataObject = CreateHtmlFormatClipboardDataObject(htmlFragment, title, sourceUri); Clipboard.Clear(); Clipboard.SetDataObject(dataObject); // now the clipboard can be pasted as text (HTML code) to text editor // or as table to MS Word or LibreOffice Writer }
0
41. Example
View licensepublic static void Clear() { // Ensure that there's no infinite recursion if(!g_csClearing.TryEnter()) { Debug.Assert(false); return; } // In some situations (e.g. when running in a VM, when using // a clipboard extension utility, ...) the clipboard cannot // be cleared; for this case we first overwrite the clipboard // with a non-sensitive text try { Copy("--", false, false, null, null, IntPtr.Zero); } catch(Exception) { Debug.Assert(false); } bool bNativeSuccess = false; try { if(!NativeLib.IsUnix()) // Windows { if(OpenW(IntPtr.Zero, true)) // Clears the clipboard { CloseW(); bNativeSuccess = true; } } else if(NativeLib.GetPlatformID() == PlatformID.MacOSX) { SetStringM(string.Empty); bNativeSuccess = true; } else if(NativeLib.IsUnix()) { SetStringU(string.Empty); bNativeSuccess = true; } } catch(Exception) { Debug.Assert(false); } g_csClearing.Exit(); if(bNativeSuccess) return; try { Clipboard.Clear(); } // Fallback to .NET framework method catch(Exception) { Debug.Assert(false); } }
0
42. Example
View licenseprivate void toolDClipboard_Click(object sender, EventArgs e) { string res = String.Format("Changeset={0}, WorkItem={1}, Date={2}, ServerPath={3}", ClickedItem.ChangesetID, ClickedItem.WorkitemID, ClickedItem.date, ClickedItem.sourcePath); Clipboard.Clear(); Clipboard.SetDataObject(res, true); }
0
43. Example
View licenseinternal void CopyToClipboard() { if (empty) { Clipboard.Clear(); } else { DataObject o = new DataObject(); foreach (KeyValuePair<string, object> p in entries) { o.SetData(p.Key, false, p.Value); } Clipboard.SetDataObject(o, true); } }
0
44. Example
View licenseprotected override void OnKeyDown(KeyEventArgs e) { #if EnableMetafileClipboardSupport if (e.Control && e.KeyCode == Keys.C) { Clipboard.Clear(); ClipboardMetafileHelper.PutEnhMetafileOnClipboard(Handle, _map.GetMapAsMetafile()); e.Handled = true; } #endif if (UseCurrentTool) { _currentTool.DoKeyDown(_map.ImageToWorld(MousePosition), e); } base.OnKeyDown(e); }
0
45. Example
View licensepublic void SetClipboardData(object data) { bool clipRetry = false; do { try { Clipboard.Clear(); Clipboard.SetDataObject(data, true, 4, 250); } catch (ExternalException) { // only show an error the first time clipRetry = (MessageBox.Show(this, strings.ClipboardInUse, WinAuthMain.APPLICATION_NAME, MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.Yes); } } while (clipRetry == true); }
0
46. Example
View licensepublic void CopyToClipBoard() { if (String.IsNullOrEmpty(_textContent.Text)) { Clipboard.Clear(); return; } Clipboard.SetText(_textContent.Text); return; }
0
47. Example
View licensepublic void CopyToClipBoard() { if (String.IsNullOrEmpty(_textContent.Text)) { Clipboard.Clear(); return; } Clipboard.SetText(_textContent.Text); return; }
0
48. Example
View licensepublic void CopyToClipBoard() { if (String.IsNullOrEmpty(_textContent.Text)) { Clipboard.Clear(); return; } Clipboard.SetText(_textContent.Text); return; }
0
49. Example
View licenseprivate void copyToolStripMenuItem_Click(object sender, EventArgs e) { Clipboard.Clear(); String clipboardText = String.Empty; foreach (DataGridViewRow row in SearchResults.SelectedRows) { for (int i = 0; i < SearchResults.ColumnCount; i++) { clipboardText += row.Cells[i].Value.ToString(); if (i + 1 < SearchResults.ColumnCount) { clipboardText += "\t"; } else { clipboardText += "\r\n"; } } } Clipboard.SetText(clipboardText); }
0
50. Example
View licenseprivate void labelVersion_Click(object sender, EventArgs e) { System.Media.SystemSounds.Asterisk.Play(); Clipboard.Clear(); Clipboard.SetText(this.labelVersion.Text); }