class ...
{
onClick()
{
while(true)
{
//call the thread from here
threadpool(request)//send request to thread using thread pool
}
}
//the function for thread
threadfunction()//function that thread calls
{
// I am not able to change the textbox/datagridview in windowsform from here the main ui gets stuck //
}
}
I dont want to change the above logic is it possible to update datagrid simaltaneously from function for thread because my program just get stuck.
The
while (true)should be inside the threadfunction, not in the onClick. Otherwise the GUI gets stuck because it’s executing endlessly thewhile(true).