Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. theForm.InvokeRequired or theElement.InvokeRequired

theForm.InvokeRequired or theElement.InvokeRequired

Scheduled Pinned Locked Moved C#
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    M 2000
    wrote on last edited by
    #1

    Hello I call FORM elements from another thread. I use Invoke/BeginInvoke for that. I access a TextBox and a ProgressBar. Can I use theForm.InvokeRequired ... to access both elements or do I have to check if for each element: textBox.InvokeRequired ... progressBar.InvokeRequired Thanks Martin

    R L 2 Replies Last reply
    0
    • M M 2000

      Hello I call FORM elements from another thread. I use Invoke/BeginInvoke for that. I access a TextBox and a ProgressBar. Can I use theForm.InvokeRequired ... to access both elements or do I have to check if for each element: textBox.InvokeRequired ... progressBar.InvokeRequired Thanks Martin

      R Offline
      R Offline
      Robert Rohde
      wrote on last edited by
      #2

      As one can assume that all controls on one Form are created within the same thread you can safely just check the Form.

      L 1 Reply Last reply
      0
      • M M 2000

        Hello I call FORM elements from another thread. I use Invoke/BeginInvoke for that. I access a TextBox and a ProgressBar. Can I use theForm.InvokeRequired ... to access both elements or do I have to check if for each element: textBox.InvokeRequired ... progressBar.InvokeRequired Thanks Martin

        L Offline
        L Offline
        leppie
        wrote on last edited by
        #3

        Only once :) All the controls would have been created on one thread :)**

        xacc.ide-0.1.3.14 - Now with syntax support for PowerShell
        xacc.ide-0.1.3.13 source code

        **

        1 Reply Last reply
        0
        • R Robert Rohde

          As one can assume that all controls on one Form are created within the same thread you can safely just check the Form.

          L Offline
          L Offline
          leppie
          wrote on last edited by
          #4

          Arggg, twice in a row I was only minutes too late ;P**

          xacc.ide-0.1.3.14 - Now with syntax support for PowerShell
          xacc.ide-0.1.3.13 source code

          **

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups