Click here to Skip to main content
15,892,005 members
Home / Discussions / C#
   

C#

 
GeneralBinding control to an object's property Pin
The Bug7-Mar-04 4:06
The Bug7-Mar-04 4:06 
GeneralRe: Binding control to an object's property Pin
Heath Stewart7-Mar-04 4:30
protectorHeath Stewart7-Mar-04 4:30 
GeneralRe: Binding control to an object's property Pin
The Bug7-Mar-04 7:01
The Bug7-Mar-04 7:01 
GeneralRe: Binding control to an object's property Pin
Heath Stewart8-Mar-04 3:57
protectorHeath Stewart8-Mar-04 3:57 
General(re-)format c# Pin
Roger Alsing6-Mar-04 21:15
Roger Alsing6-Mar-04 21:15 
GeneralRe: (re-)format c# Pin
Heath Stewart7-Mar-04 4:21
protectorHeath Stewart7-Mar-04 4:21 
GeneralMulti threading with 3 parameters Pin
dabuskol6-Mar-04 18:57
dabuskol6-Mar-04 18:57 
GeneralRe: Multi threading with 3 parameters Pin
Heath Stewart6-Mar-04 20:39
protectorHeath Stewart6-Mar-04 20:39 
Just create a class to from which the thread is started that hold these values like so:
using System;
using System.Threading;
public class MyClass
{
  public string s1, s2, s3;
  public MyClass(string s1, string s2, string s3)
  {
    this.s1 = s1;
    this.s2 = s2;
    this.s3 = s3;
  }
  public void Start()
  {
    new Thread(new ThreadStart(StartInternal)).Start();
  }
  private void StartInternal()
  {
    // Use s1, s2, and s3...
  }
}
This is a VERY basic example, but should hopefully give you one idea.

Another way is to pass arguments to the thread. The Thread class isn't capable, but ThreadPool.QueueUserWorkItem is:
object[] parms = new object[] {"Test", 1, Color.Red};
ThreadPool.QueueUserWorkItem(new WaitCallback(SomeMethod), parms);
If you want more ideas, click "Search comments" above because we've discussed this many times in the past. You should also read about Threading[^] in the .NET Framework SDK.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Multi threading with 3 parameters Pin
dabuskol7-Mar-04 0:27
dabuskol7-Mar-04 0:27 
GeneralRe: Multi threading with 3 parameters Pin
Heath Stewart7-Mar-04 4:15
protectorHeath Stewart7-Mar-04 4:15 
Questionusing Find Symbol in code? Pin
madmantk6-Mar-04 17:31
madmantk6-Mar-04 17:31 
QuestionC# PropertyBag? Pin
meago6-Mar-04 16:58
meago6-Mar-04 16:58 
AnswerRe: C# PropertyBag? Pin
Heath Stewart6-Mar-04 17:50
protectorHeath Stewart6-Mar-04 17:50 
GeneralIcon image loses quality after deserialization Pin
Flack6-Mar-04 12:27
Flack6-Mar-04 12:27 
GeneralRe: Icon image loses quality after deserialization Pin
Member 9300226-Mar-04 19:46
Member 9300226-Mar-04 19:46 
GeneralRe: Icon image loses quality after deserialization Pin
Member 9300226-Mar-04 19:48
Member 9300226-Mar-04 19:48 
GeneralToo many apps opening Pin
BigBlob2026-Mar-04 9:00
BigBlob2026-Mar-04 9:00 
GeneralRe: Too many apps opening Pin
Heath Stewart6-Mar-04 17:46
protectorHeath Stewart6-Mar-04 17:46 
Questionhow to get Serial Number? Pin
SherKar6-Mar-04 7:29
SherKar6-Mar-04 7:29 
AnswerRe: how to get Serial Number? Pin
Mazdak6-Mar-04 10:48
Mazdak6-Mar-04 10:48 
QuestionAccess to Streaming data? Pin
holt6-Mar-04 5:31
holt6-Mar-04 5:31 
AnswerRe: Access to Streaming data? Pin
ian mariano6-Mar-04 6:22
ian mariano6-Mar-04 6:22 
Generalfrom a listbox to a database Pin
ASGill6-Mar-04 5:05
ASGill6-Mar-04 5:05 
GeneralRe: from a listbox to a database Pin
Mazdak6-Mar-04 7:28
Mazdak6-Mar-04 7:28 
GeneralRe: from a listbox to a database Pin
ASGill6-Mar-04 17:44
ASGill6-Mar-04 17:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.