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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Two simple questions

Two simple questions

Scheduled Pinned Locked Moved C#
question
3 Posts 2 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
    mikker_123
    wrote on last edited by
    #1

    -Does Form.BeginInvoke needs to end with Form.EndInvoke? -Is it safe to access property or attribute (Text, Color) of Control from thread other than the one that created it? I know that you can't modify it but can you just read it (don't care about dirty read)?

    RaviBeeR 1 Reply Last reply
    0
    • M mikker_123

      -Does Form.BeginInvoke needs to end with Form.EndInvoke? -Is it safe to access property or attribute (Text, Color) of Control from thread other than the one that created it? I know that you can't modify it but can you just read it (don't care about dirty read)?

      RaviBeeR Offline
      RaviBeeR Offline
      RaviBee
      wrote on last edited by
      #2

      mikker_123 wrote:

      Does Form.BeginInvoke needs to end with Form.EndInvoke?

      No, because it's the equivalent of Win32 PostMessage() that occurs on the same thread.

      mikker_123 wrote:

      Is it safe to access property or attribute (Text, Color) of Control from thread other than the one that created it?

      Not unless you can guarantee that the creator thread will never write to it. Even then, this may cause an exception in code developed using VS2005. (You can disable this exception checking). /ravi

      Just say "No" to Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

      M 1 Reply Last reply
      0
      • RaviBeeR RaviBee

        mikker_123 wrote:

        Does Form.BeginInvoke needs to end with Form.EndInvoke?

        No, because it's the equivalent of Win32 PostMessage() that occurs on the same thread.

        mikker_123 wrote:

        Is it safe to access property or attribute (Text, Color) of Control from thread other than the one that created it?

        Not unless you can guarantee that the creator thread will never write to it. Even then, this may cause an exception in code developed using VS2005. (You can disable this exception checking). /ravi

        Just say "No" to Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

        M Offline
        M Offline
        mikker_123
        wrote on last edited by
        #3

        Tnx a lot! Cheers...

        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