Click here to Skip to main content
12,748,323 members (40,702 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB threads 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 19:26pm
Updated 28-Jan-13 19:28pm

1 solution

Rate this: bad
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.
Anurag Daolagajao 29-Jan-13 10:01am
"object of design" .. can you explain a little more?
Mike Meinz 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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170215.1 | Last Updated 29 Jan 2013
Copyright © CodeProject, 1999-2017
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