Click here to Skip to main content
15,895,192 members
Home / Discussions / C#
   

C#

 
Questioncross thread Pin
Yustme28-Feb-10 6:28
Yustme28-Feb-10 6:28 
AnswerRe: cross thread Pin
Dan Mos28-Feb-10 6:33
Dan Mos28-Feb-10 6:33 
GeneralRe: cross thread Pin
Yustme28-Feb-10 6:35
Yustme28-Feb-10 6:35 
GeneralRe: cross thread [modified] Pin
Dan Mos28-Feb-10 6:44
Dan Mos28-Feb-10 6:44 
GeneralRe: cross thread Pin
Alex Manolescu28-Feb-10 7:10
Alex Manolescu28-Feb-10 7:10 
GeneralRe: cross thread [modified] Pin
Dan Mos28-Feb-10 7:27
Dan Mos28-Feb-10 7:27 
GeneralRe: cross thread Pin
Alex Manolescu4-Jun-10 22:27
Alex Manolescu4-Jun-10 22:27 
GeneralRe: cross thread Pin
DaveyM6928-Feb-10 7:15
professionalDaveyM6928-Feb-10 7:15 
I do pretty much the same as Moshu except I invoke the method again from within the method if required (recursion) and repass the parameters rather than hardcoding them.
C#
private void SetText(Control control, string text)
{
    if (InvokeRequired)
        Invoke(new MethodInvoker(delegate { SetText(textBox, text); }));
    else
        control.Text = text;
}
Dave

Tip: Passing values between objects using events (C#)

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Why are you using VB6? Do you hate yourself? (Christian Graus)

GeneralRe: cross thread Pin
Yustme28-Feb-10 7:21
Yustme28-Feb-10 7:21 
GeneralRe: cross thread Pin
DaveyM6928-Feb-10 7:48
professionalDaveyM6928-Feb-10 7:48 
AnswerRe: cross thread Pin
Luc Pattyn28-Feb-10 8:50
sitebuilderLuc Pattyn28-Feb-10 8:50 
GeneralRe: cross thread Pin
Yustme28-Feb-10 12:10
Yustme28-Feb-10 12:10 
QuestionA List Of Values component or user control! Pin
Hussam Fattahi28-Feb-10 4:54
Hussam Fattahi28-Feb-10 4:54 
AnswerRe: A List Of Values component or user control! Pin
Abhinav S28-Feb-10 5:57
Abhinav S28-Feb-10 5:57 
AnswerRe: A List Of Values component or user control! Pin
Dan Mos28-Feb-10 7:05
Dan Mos28-Feb-10 7:05 
QuestionGetting the column items in a datagrid Pin
Wamuti28-Feb-10 2:40
Wamuti28-Feb-10 2:40 
AnswerRe: Getting the column items in a datagrid [modified] Pin
Dan Mos28-Feb-10 3:11
Dan Mos28-Feb-10 3:11 
AnswerRe: Getting the column items in a datagrid Pin
Mycroft Holmes28-Feb-10 3:50
professionalMycroft Holmes28-Feb-10 3:50 
AnswerRe: Getting the column items in a datagrid Pin
DX Roster4-Mar-10 18:56
DX Roster4-Mar-10 18:56 
QuestionSliding panels Pin
Wamuti27-Feb-10 23:35
Wamuti27-Feb-10 23:35 
AnswerRe: Sliding panels Pin
Luc Pattyn27-Feb-10 23:41
sitebuilderLuc Pattyn27-Feb-10 23:41 
AnswerRe: Sliding panels Pin
Wamuti27-Feb-10 23:49
Wamuti27-Feb-10 23:49 
GeneralRe: Sliding panels Pin
OriginalGriff28-Feb-10 0:26
mveOriginalGriff28-Feb-10 0:26 
AnswerMessage Closed Pin
28-Feb-10 1:01
stancrm28-Feb-10 1:01 
GeneralRe: Sliding panels Pin
Wamuti28-Feb-10 1:18
Wamuti28-Feb-10 1:18 

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.