Help with ThreadPool parameter?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brett Romero

    Help with ThreadPool parameter?

    I'd like to use

    ThreadPool.Queu eUserWorkItem( new WaitCallback( flashRowColor(d gv) ) );

    in a couple of places.

    I have a method the callback should use:

    private void flashRowColor( object pDataGridView ){...}

    I've tried several combinations of using delegate keyword, parameters
    for WaitCallback() but nothing seems to work for this scenario. I'm
    currently using ParameterizedTh readStart(), which works fine.

    But now I want to know how to get QueueUserWorkIt em working. If
    QueueUserWorkIt em will work somehow, can I type the "object" parameter
    on WaitCallback() as DataGridView to avoid casting the target?

    Thanks,
    Brett

  • Mattias Sjögren

    #2
    Re: Help with ThreadPool parameter?

    >ThreadPool.Que ueUserWorkItem( new WaitCallback( flashRowColor(d gv) ) );

    Try

    ThreadPool.Queu eUserWorkItem(n ew WaitCallback(fl ashRowColor), dgv);


    Mattias

    --
    Mattias Sjögren [C# MVP] mattias @ mvps.org
    http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
    Please reply only to the newsgroup.

    Comment

    Working...