Click here to Skip to main content
15,915,019 members
Home / Discussions / C#
   

C#

 
GeneralRe: adding more than one control to the single cell in datagridview control Pin
musefan19-Mar-09 2:48
musefan19-Mar-09 2:48 
QuestionThreading Questions - Object Ownership Pin
Jammer19-Mar-09 1:33
Jammer19-Mar-09 1:33 
AnswerRe: Threading Questions - Object Ownership Pin
Fayu19-Mar-09 3:09
Fayu19-Mar-09 3:09 
GeneralRe: Threading Questions - Object Ownership Pin
Jammer19-Mar-09 4:44
Jammer19-Mar-09 4:44 
GeneralRe: Threading Questions - Object Ownership Pin
Fayu19-Mar-09 5:33
Fayu19-Mar-09 5:33 
GeneralRe: Threading Questions - Object Ownership Pin
Jammer19-Mar-09 8:57
Jammer19-Mar-09 8:57 
GeneralRe: Threading Questions - Object Ownership Pin
Fayu19-Mar-09 9:44
Fayu19-Mar-09 9:44 
GeneralRe: Threading Questions - Object Ownership [modified] Pin
Fayu19-Mar-09 13:40
Fayu19-Mar-09 13:40 
I looked at your code and it seems like you are using WPF. This changes things. Multithreading is a little different in WPF. The code below should resolve your issue:

if (ThreadCompleted != null) //Check to see if event is subscribed to
{
    //Get the calling window object
    Window caller = (Window)this.ThreadCompleted.Target;

    //Check to see if syncronization is required
    //The CheckAccess method will not be visible by Intellisence but it's there...
    if (!caller.Dispatcher.CheckAccess())
    {
        //Create delegate
        ThreadCompleterEventHandler del = new ThreadCompleterEventHandler(OnThreadCompleted);

        //paramers that you want to pass
        object[] args = { sender, e };

        //"Syncronize"
        caller.Dispatcher.Invoke(del, args);

        //Make a call to OnThreadCompleted using delegate
        return;
    }
    //Threads will be synced above.  This code will run after threads are synced
    this.ThreadCompleted(sender, e);
}


Hope this helps.

modified on Friday, March 20, 2009 8:53 AM

QuestionUsing Rejex to validate user name Pin
shabya19-Mar-09 1:24
shabya19-Mar-09 1:24 
AnswerRe: Using Rejex to validate user name Pin
musefan19-Mar-09 1:40
musefan19-Mar-09 1:40 
GeneralRe: Using Rejex to validate user name Pin
shabya19-Mar-09 2:42
shabya19-Mar-09 2:42 
GeneralRe: Using Rejex to validate user name Pin
musefan19-Mar-09 2:46
musefan19-Mar-09 2:46 
GeneralRe: Using Rejex to validate user name Pin
Ian Shlasko19-Mar-09 3:27
Ian Shlasko19-Mar-09 3:27 
GeneralRe: Using Rejex to validate user name Pin
musefan19-Mar-09 3:31
musefan19-Mar-09 3:31 
GeneralRe: Using Rejex to validate user name Pin
shabya19-Mar-09 3:59
shabya19-Mar-09 3:59 
AnswerRe: Using Rejex to validate user name Pin
Eslam Afifi19-Mar-09 3:26
Eslam Afifi19-Mar-09 3:26 
GeneralRe: Using Rejex to validate user name Pin
shabya19-Mar-09 3:57
shabya19-Mar-09 3:57 
QuestionSerialization Pin
Paul Unsworth19-Mar-09 1:03
Paul Unsworth19-Mar-09 1:03 
AnswerRe: Serialization Pin
Cracked-Down19-Mar-09 1:10
Cracked-Down19-Mar-09 1:10 
AnswerRe: Serialization Pin
Cracked-Down19-Mar-09 1:23
Cracked-Down19-Mar-09 1:23 
GeneralRe: Serialization Pin
Paul Unsworth19-Mar-09 1:27
Paul Unsworth19-Mar-09 1:27 
GeneralRe: Serialization Pin
Cracked-Down19-Mar-09 2:10
Cracked-Down19-Mar-09 2:10 
QuestionEncrypt bitmap image for C# Windows application [modified] Pin
nudma19-Mar-09 0:59
nudma19-Mar-09 0:59 
AnswerRe: Encrypt bitmap image for C# Windows application Pin
Michael Bookatz19-Mar-09 1:17
Michael Bookatz19-Mar-09 1:17 
AnswerRe: Encrypt bitmap image for C# Windows application Pin
Henry Minute19-Mar-09 6:23
Henry Minute19-Mar-09 6:23 

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.