Results 1 to 4 of 4

Thread: [resolved] screen form update from thread

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2008
    Posts
    2

    Resolved [resolved] screen form update from thread

    Hi.
    I am trying to write multithread program for my PDA. I have problem to change any controls on program Form1 from the thread code.

    For example on main program screen - Form1 I have text box defined as Form1.label.text. I can modify it easly like:

    Form1.label.text="aaaa"

    but it works only from main program flow. The same code does not work after thread.start() statement (no error appears)

    Can someone help me to solve it? What should I do to enable Form1 components changes from thread process?
    Last edited by plexi; Jun 13th, 2008 at 05:55 PM.

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: screen form update from thread

    Hello,

    In order to do this, you have to Invoke a delegate method to perform the update on behalf of the worker thread.

    You can find an example of doing this in the following article.

    Hope this helps!!

    Gary

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2008
    Posts
    2

    Re: [resolved] screen form update from thread

    Thank you very much, it works now.

  4. #4
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: [resolved] screen form update from thread

    Good stuff, glad it worked for you!!

    If you think my post helped, don't forget to rate it

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width