Click here to Skip to main content
Sign Up to vote bad
good
See more: ThreadingVB.NET
So far while working with multiple threads, i edit ui elements using delegates & invoke. The problem is for changing different ui elements, i have to define a new sub every time since the "thread.start()" method only takes one parameter so i cannot stuff everything in one sub. Is there a way of using multiple parameters with the "thread.start()" method?
Posted 28 Jan '13 - 18:26
Edited 28 Jan '13 - 18:28


1 solution

The parameter passed to thread.start() is an object. You can create an object of your design and have all the values you wish to pass to thread.start() inside that object.
  Permalink  
Comments
Anurag Daolagajao - 29 Jan '13 - 10:01
"object of design" .. can you explain a little more?
Mike Meinz - 29 Jan '13 - 10:10
You could design a Structure or a Class with properties. Instantiate the structure or class and populate with all of the data that you want to pass to thread.start(). An example of a Structure statement can be found here: Structure Statement
Mike Meinz - 29 Jan '13 - 10:57
This article has an example of passing a structure to thread.start() See Threading Introduction - In the article, see how a structure Structure PermuteStruct is defined, populated and passed to thread.start

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 443
1 Arun Vasu 381
2 OriginalGriff 345
3 Maciej Los 191
4 Aarti Meswania 190
0 Sergey Alexandrovich Kryukov 9,755
1 OriginalGriff 7,559
2 CPallini 4,018
3 Rohan Leuva 3,362
4 Maciej Los 2,951


Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 29 Jan 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid