English 中文(简体)
视窗应用中的校对操作不有效[复制]
原标题:Cross-Thread operation not valid in Windows Application [duplicate]
This question already has answers here:
Closed 11 years ago.

Possible Duplicate:
Cross-thread operation not valid

我试图操纵这2条线,以控制 un子和雷多顿,使之得以或无法做到,但一刀切的十字路口不有效,即试图利用 but子制造援引,而使用 could子。

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;
    }
问题回答

原因是,除非你在表格上签字,否则你不能对表格采取任何行动。 然后将使用标准表格发送线。 为了更新表格,你必须使用

如果你加入世界森林论坛,你必须把申请发送器的物体送进国际宇宙航行联合会:

Application.Current.Dispatcher.BeginInvoke(() =>
{
   UndoButton.Enabled = _undoBuffer.CanUndo;
});




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签