i;ve found a weird problem.
'backup clipboard
dim backup = Clipboard.GetDataObject()
Dim o As New Object
Clipboard.SetDataObject(o) 'Clear clipboard (confirm working)
'restore clipboard
Clipboard.SetDataObject(backup)
these codes works for filedrop format but not text format.
what i do is this :
i open notepad and type some text in, then highlight and copy them. after that i run the backup portion of code above, then yeah the clipboard is not empty. after that i run the restore portion of code then suppose it has been restored back to clipboard but when i right click on notepad i've found that the 'paste' word exist but when i paste nothing pasted.
but indeed i run another code:
Clipboard.GetDataObject.GetDataPresent(Dataformats.text)
it returns true, that mean there are text exist in clipboard, but the text is somehow corrupted and cannot be paste to notepad.
ok, as i said it works for filedrop, means when i copy a file, eg. abc.mp3, then i backup it, and restore it the mp3 file in clipboard still exist as before.
why it's not working for text?
code for backup and restore attached.. can anyone test it out and tell me why text format cannot be backup and restore?