Solved

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

Posted on 2004-08-26
2
235 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

813 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now