Solved

Q. How do you start 2 or more other classes to threading from a single Form1??

Posted on 2004-08-26
2
237 Views
Last Modified: 2010-04-15
Q. How do you start 2 or more other classes to threading from a single Form1??

I tried this code on Form1 (Form1_Load) but if failed...

objClass1 = new Class1();
objClass1 = new Thread(new ThreadStart(StartMoveKing));
      
 // also

objClass2 = new Class2();
objClass2 = Thread(new ThreadStart(StartMoveQueen));
0
Comment
Question by:kvnsdr
  • 2
2 Comments
 
LVL 3

Expert Comment

by:gillgates
ID: 11908434
using System.Threading;

Class1 objClass1;
Thread t;

objClass1 = new Class1();
t = new Thread(new ThreadStart(objClass1.YourFunc));
t.Start();
0
 
LVL 3

Accepted Solution

by:
gillgates earned 250 total points
ID: 11908445
using System.Threading;

Class1 objClass1;
Class2 objClass2;
Thread t1;
Thread t2;

objClass1 = new Class1();
t1 = new Thread(new ThreadStart(objClass1.StartMoveKing));
t1.Start();

objClass2 = new Class2();
t2 = Thread(new ThreadStart(StartMoveQueen));
t2.Start();
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question