I have an application written in WPF that requires the user to fill in some textboxes in a uniform grid. When all of the cells have been filled in and validated, the code calls the Clipboard.Clear() method and then copies the information in the cells to the clipboard. This application worked just fine on both WindowsXP and Windows 7. However, we recently upgraded to Windows 8, and it fails when copying to the clipboard. The line in question is the following:
Clipboard.SetData(DataFormats.Text, cellContents.ToString());
The error is the following:
OpenClipboard Failed (Exception from HRESULT: 0x800401D0 (CLIPBRD_E_CANT_OPEN))
I have tried adding a delay in the code, but that only works if I step through the code. Otherwise, I cannot seem to make the delay long enough.
Is there any reason why this would work differently on the Windows 8 desktop versus Windows 7 and WindowsXP? Is there anything else I should be doing to get this to work in Windows 8?
Thanks in advance for your help!
Christine A. Piffat