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. What is this advantage?

What is this advantage?

Scheduled Pinned Locked Moved C#
question
2 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.
  • A Offline
    A Offline
    ASysSolvers
    wrote on last edited by
    #1

    here I have wriiten some code from my application. I j't want to know what is the advantage of this invoke method,..'coz i joined this application partially and that is almost done.If you guys know about this and eny comments plese send me.... switch (_amxStr.Trim()) { case "DON": this.Invoke((System.Threading.ThreadStart)delegate() { showDND(); strAMX = ""; frmMain.AMX_String = ""; }); break; case "DOF": this.Invoke((System.Threading.ThreadStart)delegate() { hideDND(); strAMX = ""; frmMain.AMX_String = ""; }); break; }

    S 1 Reply Last reply
    0
    • A ASysSolvers

      here I have wriiten some code from my application. I j't want to know what is the advantage of this invoke method,..'coz i joined this application partially and that is almost done.If you guys know about this and eny comments plese send me.... switch (_amxStr.Trim()) { case "DON": this.Invoke((System.Threading.ThreadStart)delegate() { showDND(); strAMX = ""; frmMain.AMX_String = ""; }); break; case "DOF": this.Invoke((System.Threading.ThreadStart)delegate() { hideDND(); strAMX = ""; frmMain.AMX_String = ""; }); break; }

      S Offline
      S Offline
      S Senthil Kumar
      wrote on last edited by
      #2

      Take a look at www.codeproject.com/KB/cpp/begininvoke.aspx[^]. The short story is that you can't directly access UI elements from any random thread, only from the thread that created the element. To update the UI from a different thread, you "marshal" the delegate to the UI thread.

      Regards Senthil [MVP - Visual C#] _____________________________ My Blog | My Articles | My Flickr | WinMacro

      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