I have the code below (but doesn't work) .. i need to wait till the thread complete its job then execute then next command
private void btnPaste_Click(object sender, EventArgs e)
{
if (copiedItems != null)
{
if (copy)
{
System.Threading.Thread thPASTE = new System.Threading.Thread(PasteFromCopy);
thPASTE.Start(currAddress);
lock (this)
{
btnRefresh_Click(sender, e);
}
}
else
{
System.Threading.Thread thPASTE = new System.Threading.Thread(PasteFromMove);
thPASTE.Start(currAddress);
lock (this)
{
btnRefresh_Click(sender, e);
}
}
}
}
the paste should do some code then after that i should refresh the list im showing.. i need to do it this way, because it doesn't work for me when i call the refresh in the thread
how do i do it ??