Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8683771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:07:49+00:00 2026-06-12T22:07:49+00:00

In Winforms, all controls have an InvokeRequired property, that returns true if I have

  • 0

In Winforms, all controls have an InvokeRequired property, that returns true if I have to call .[Begin]Invoke on the control in order to modify it.

In WPF, there is an apparently similar construct in DispatcherObject.CheckAccess() and Dispatcher.CheckAccess(), but I am frightened by the EditorBrowsable(EditorBrowsableState.Never) attribute. When I disable editor browsing like this, I use it to means “You should not be doing this. No, really. If this is required solve your immediate problem, you have mis-designed your solution to your overarching problem.” On the other hand, the only alternative I’ve found (and, in fact, my original solution) is Thread.CurrentThread.ManagedThreadId == 1. (It’s horrible. And it doesn’t work in the generic case. I know. It does work for my limited uses, though.)

The MSDN documentation is silent on the presence of and reasoning behind the EditorBrowsable attribute. Does it indeed mean “do not use this”, as it would if I had typed it, or does it have some other less prohibitive meaning?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:07:50+00:00Added an answer on June 12, 2026 at 10:07 pm

    In WPF, you can call Dispatcher.Invoke regardless of your current thread, and it’ll handle the call accordingly – if you’re already on the right thread, it’ll just invoke your code, and it uses CheckAccess to handle this behaviour.

    For a BeginInvoke the thread you’re currently on is irrelevant: BeginInvoke is always asyncronous, and the order of execution is dependant on the priority of the item you add to the dispatcher’s queue.

    If you weren’t supposed to use the method at all, it wouldn’t be public: the intent of that attribute is only to hide the member from mechanisms such as Intellisense and other editor-browsers. You don’t typically need to use Dispatcher.CheckAccess() yourself, which is probably why it’s marked as non-browsable, but the wisdom of this is something we can only guess at (unless Eric Lippert is watching 😉

    In summary: just call Dispatcher.Invoke and don’t worry about CheckAccess.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some WinForms controls that I need to use in a WPF window.
I have a WinForms Form with a few controls on it. All of them
I have a VS2010 Winforms project with several forms and user controls, all integrated
I have a WinForms app that contains several comboboxes, numericupdown controls and checkboxes. I
In winforms/C# most all UI Controls have a .Tag tag, so like myButton.Tag =
I have a WinForms app that contains many NumericUpDown controls. In a nutshell, if
Do all the windows and controls (including active-x) displayed inside WinForms application are derived
I have to enable all the text in a winforms application to be replaced;
I am using C# and Winforms 3.5 I have a list of user controls
Winforms .net 3.5 app. In my app I have a generic class that looks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.