You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think there might be some bug with the library itself, or the problem might be underlying on System.Windows.Forms.Clipboard class, when I set an image using System.Windows.Forms.Clipboard.SetImage() method, SharpClipboard's ClipboardChanged event is fired TWICE for no reason.
Is there anyone noticed that problem which occurs when you copy/set any image using Clipboard.SetImage() method?
Best regards.
The text was updated successfully, but these errors were encountered:
The Clipboard.SetImage() method changes the clipboard twice:
1 - It clears the clipboard
2 - It loads the new image into the clipboard.
This is also true of Clipboard.SetText() and others ...
The way I handle this is to create a global class property (integer) called "Ignore". Every time I use the various .Set methods, I first increment (increase) the "Ignore" property by 2. When the WM message comes in (or when SharpClipboard's "ClipboardChanged" event is fired), I have an IF statement, so that it will only process that clipboard message if "ignore" = 0. Each time we ignore a message, we decrement (decrease) the "Ignore" property by 1 after we ignore the message. This will allow us to know when an end-user has copied something new to the clipboard, vs. when we have changed the clipboard ourselves with our code.
Hi,
I think there might be some bug with the library itself, or the problem might be underlying on System.Windows.Forms.Clipboard class, when I set an image using System.Windows.Forms.Clipboard.SetImage() method, SharpClipboard's ClipboardChanged event is fired TWICE for no reason.
Is there anyone noticed that problem which occurs when you copy/set any image using Clipboard.SetImage() method?
Best regards.
The text was updated successfully, but these errors were encountered: