Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

791 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