Possible Duplicate:
Cross-thread operation not valid
I m trying to run this 2 thread to control the undo and redo button to be enabled or not, but i m getting cross thread not valid, i tried to create an invoke but i couldn't using the button
here is my code
private Thread _undoThread;
private Thread _redoThread;
_undoThread = new Thread(UndoEnabledCheck);
_undoThread.Start();
_redoThread = new Thread(RedoEnabledCheck);
_redoThread.Start();
private void UndoEnabledCheck()
{
UndoButton.Enabled = _undoBuffer.CanUndo;
}
private void RedoEnabledCheck()
{
RedoButton.Enabled = _undoBuffer.CanRedo;
}