I'm having a stupid problem trying to clear the clipboard in C# 3.5 on Windows 7 - every time I do this the explorer crashes.
At first I didn't know my application is causing this so I spent about a week and a half trying to find the problem.
In the end, a guy from MS forum "remembered" that Windows 7 has a bug that causes explorer.exe to crash every time you try to manipulate the clipboard :|. Apparently Firefox had the same problem a while ago.
At first I tried the simple way: Clipboard.Clear();
Since this was causing the crash I decided to add a control var so that I can check if the clipboard is empty or not:
bool full_clipboard_view = false;
private void txtLic_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (txtLic.Text != "")
{
full_clipboard_view = true;
this.txtLic.SelectAll();
Clipboard.SetText(this.txtLic.Text);
}
else
MessageBox.Show("Please select an item first!");
}
private void btnClose_Click(object sender, EventArgs e)
{
if (full_clipboard_view == true)
Clipboard.Clear();
this.Close();
}
This also didn't solve my problem so I decided to suspend this part for awhile.
Now I'm almost done with this app and I still cant find a way to fix this.
Did anyone encounter this problem before?

New Topic/Question
Reply




MultiQuote




|