Results 1 to 2 of 2

Thread: Another Thread Problem

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    181

    Another Thread Problem

    Hey. Ok so I have a thread and it runs a few methods. At a certain time, the thread is supposed to call a method that's not in the thread. This method includes setting labels visible and making the forum bigger. For some reason it never works. It appears that this thread isn't able to call a non-thread method. Does this sound right? Any ideas on what I could do to fix this?

    Thanks
    John

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Another Thread Problem

    There's no such things as thread methods and non-thread methods. The same method can be executed in more than one thread. It just depends where it was called from. If you're trying to affect the UI from a worker thread then that's your problem. Search the forum for "invokerequired" and my user name and you'll find multiple examples of using a delegate to affect the UI from a worker thread.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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