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. why is thread not working with graphic object?? [modified]

why is thread not working with graphic object?? [modified]

Scheduled Pinned Locked Moved C#
graphicsquestionannouncement
5 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.
  • S Offline
    S Offline
    samtam
    wrote on last edited by
    #1

    Can anyone tell me why is this scenario not working? A tabcontrol's paint event draws a rectangle and simultaneously a thread should update a label on that tabcontrol. Thread is created when the form is loaded. but its not working..... Label is not shown untill the drawing is completed. i cant figure out, what did i miss??? Any suggestions Thanks in advance -- modified at 2:37 Tuesday 17th October, 2006

    G S 2 Replies Last reply
    0
    • S samtam

      Can anyone tell me why is this scenario not working? A tabcontrol's paint event draws a rectangle and simultaneously a thread should update a label on that tabcontrol. Thread is created when the form is loaded. but its not working..... Label is not shown untill the drawing is completed. i cant figure out, what did i miss??? Any suggestions Thanks in advance -- modified at 2:37 Tuesday 17th October, 2006

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Even if a separate thread is updating the label, the event for redrawing it is executed in the main thread.

      --- b { font-weight: normal; }

      S 1 Reply Last reply
      0
      • G Guffa

        Even if a separate thread is updating the label, the event for redrawing it is executed in the main thread.

        --- b { font-weight: normal; }

        S Offline
        S Offline
        samtam
        wrote on last edited by
        #3

        Thanks , but how can this be achieved. i need to do both the things in parallel,,what do u suggest?

        G 1 Reply Last reply
        0
        • S samtam

          Can anyone tell me why is this scenario not working? A tabcontrol's paint event draws a rectangle and simultaneously a thread should update a label on that tabcontrol. Thread is created when the form is loaded. but its not working..... Label is not shown untill the drawing is completed. i cant figure out, what did i miss??? Any suggestions Thanks in advance -- modified at 2:37 Tuesday 17th October, 2006

          S Offline
          S Offline
          sam
          wrote on last edited by
          #4

          i hope this.Update(); will solve your problem sameer

          1 Reply Last reply
          0
          • S samtam

            Thanks , but how can this be achieved. i need to do both the things in parallel,,what do u suggest?

            G Offline
            G Offline
            Guffa
            wrote on last edited by
            #5

            If you draw a rectangle and then update the label, the time difference should not be noticable. Most of the time they would both be drawn within the same page refresh, so there would be no delay at all. What is is that you do that is taking time?

            --- b { font-weight: normal; }

            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