Click here to Skip to main content
15,905,316 members
Home / Discussions / C#
   

C#

 
GeneralRe: combobox and auto-completion Pin
gibono8-May-05 23:22
gibono8-May-05 23:22 
Questionhow to bind a richtextbox control's rtf property to the database?? Pin
2-May-05 21:04
suss2-May-05 21:04 
GeneralArchive Mail Reader Pin
Member 21255652-May-05 20:23
Member 21255652-May-05 20:23 
GeneralText Box doesn't show new Value Pin
RobertS.2-May-05 15:53
sussRobertS.2-May-05 15:53 
GeneralRe: Text Box doesn't show new Value Pin
Dan_P2-May-05 16:05
Dan_P2-May-05 16:05 
GeneralUpButton and DownButton methods Pin
JeffHarrold2-May-05 15:52
JeffHarrold2-May-05 15:52 
GeneralRe: UpButton and DownButton methods Pin
JeffHarrold3-May-05 13:11
JeffHarrold3-May-05 13:11 
Generalbrowsing the web from widows application Pin
Modern_night2-May-05 15:29
Modern_night2-May-05 15:29 
GeneralRe: browsing the web from widows application Pin
Christian Graus2-May-05 16:25
protectorChristian Graus2-May-05 16:25 
GeneralRe: browsing the web from widows application Pin
Polis Pilavas3-May-05 3:37
Polis Pilavas3-May-05 3:37 
QuestionPropertyGrid - how to apply changes? Pin
czajajajatoszmaciarz2-May-05 13:04
czajajajatoszmaciarz2-May-05 13:04 
AnswerRe: PropertyGrid - how to apply changes? Pin
Dan_P2-May-05 15:03
Dan_P2-May-05 15:03 
AnswerRe: PropertyGrid - how to apply changes? Pin
Mathew Hall2-May-05 15:03
Mathew Hall2-May-05 15:03 
GeneralRe: PropertyGrid - how to apply changes? Pin
Anonymous3-May-05 10:00
Anonymous3-May-05 10:00 
GeneralRead only Outlookbar Pin
Member 19299502-May-05 12:43
Member 19299502-May-05 12:43 
GeneralRe: Read only Outlookbar Pin
MoustafaS2-May-05 13:14
MoustafaS2-May-05 13:14 
GeneralUrl navigation Pin
Adnan Siddiqi2-May-05 10:42
Adnan Siddiqi2-May-05 10:42 
GeneralRe: Url navigation Pin
leppie2-May-05 14:57
leppie2-May-05 14:57 
QuestionCancellable operation -- recommended practice? Pin
Judah Gabriel Himango2-May-05 9:42
sponsorJudah Gabriel Himango2-May-05 9:42 
AnswerRe: Cancellable operation -- recommended practice? Pin
Marc Clifton2-May-05 10:56
mvaMarc Clifton2-May-05 10:56 
GeneralRe: Cancellable operation -- recommended practice? Pin
Judah Gabriel Himango2-May-05 11:03
sponsorJudah Gabriel Himango2-May-05 11:03 
QuestionPassing methods to ThreadStart - Possible? Pin
stan282-May-05 8:52
stan282-May-05 8:52 
AnswerRe: Passing methods to ThreadStart - Possible? Pin
Judah Gabriel Himango2-May-05 9:05
sponsorJudah Gabriel Himango2-May-05 9:05 
Yes, but not with Thread.Start (although you can in .NET 2.0, because Thread.Start will have overloads to take a ParameterizedThreadStart, which allows you to pass a System.Object parameter).

For .NET 1.x code, you have 2 options.

You could use the built-in .NET threadpool:

void SomeMethod(object parameter)
{
   // Assume we passed in an int[].
   int[] typedParam = (int[])parameter;
}

WaitCallback waitCallback = new WaitCallback(SomeMethod);
ThreadPool.QueueUserWorkItem(waitCallback, new int[]{1, 5});


Or you can define your own delegate (or use an existing one) that matches your desired method signature (i.e. has the correct number of parameters and the correct parameter types), then call delegate.BeginInvoke on it:

delegate void MethodWithTwoIntegers(int a, int b);

void SomeMethod(int a, int b)
{
}

MethodWithTwoIntegers myMethod = new MethodWithTwoIntegers(SomeMethod);
myMethod.BeginInvoke(5, 10, null, null);


Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Horrific Minnesota Radio
Judah Himango


AnswerRe: Passing methods to ThreadStart - Possible? Pin
Marc Clifton2-May-05 10:52
mvaMarc Clifton2-May-05 10:52 
AnswerRe: Passing methods to ThreadStart - Possible? Pin
leppie2-May-05 14:29
leppie2-May-05 14:29 

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.