Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Threading VB.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:26pm
Edited 28-Jan-13 18:28pm
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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 at 29-Jan-13 10:01am
   
"object of design" .. can you explain a little more?
Mike Meinz at 29-Jan-13 10:10am
   
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 at 29-Jan-13 10:57am
   
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
0 Maciej Los 589
1 OriginalGriff 309
2 CPallini 205
3 RyanDev 165
4 Sharmanuj 109
0 OriginalGriff 5,689
1 Sergey Alexandrovich Kryukov 4,783
2 Peter Leow 2,954
3 Maciej Los 2,819
4 DamithSL 2,465


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 29 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100