ListView threading issue

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi Guys

I have a problem which I can't solve and hope you can give right direction.
I have a form with listview and slider control. That form runs another
thread (background) which do some operation based on slider current value
and modifies some item in listview. I've read that WinForm controls are not
thread safe and confirmed that myself. Can you tell me how should I protect
listview (problem is in control drawing) and slider controls (problem is in
quering the value)?
the pseudocode follows:

threadfunc()
{
foreach (item in listview)
{
int value = get_slider_value()
string str = do_some_calculation(item, value);
item.SubItems[1] = str;
}
}

Thanks in advance

Regards
Yeghia


.



Relevant Pages

  • Re: Setting slider value
    ... >>> Regards, ... >>> Joachim ... But it is a slider control for sure. ... > Any ideas why VB want to make it a lowercase 'v'? ...
    (microsoft.public.vb.controls)
  • Re: dim test as new form1
    ... > listview in the mdi parent form1 refreches, ... >> form4 is a childform and has no children ... >> regards, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: List View or Data Grid
    ... including the virtual view to process a large amount of data. ... Regards, ... > meaning that I can Create, Delete, Edit and Sort my data under my Pocket ... I just wonder should I choose ListView or DataGrid? ...
    (microsoft.public.pocketpc.developer)
  • Re: simulating double click from within VB.NET
    ... Then I could imagine that e.X or e.Y is than the maximum width/height of your listview. ... Best regards, ... You can use the HitTest function of the listview and then check the Location property of the ListViewHitTestInfo returned from the function. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Listview problems
    ... > In a little program i am writing i have a listview, ... > But when a user double clicks a line in the listview (detail mode), ... > Best regards ... > Søren Reinke ...
    (microsoft.public.dotnet.languages.csharp)