Versions des environnements
>>Hello All,
>>
>>I am using VB.NET, the latest one that comes with Visual Studio 2015 and have a situation where I have a loop and within the loop, I display a form (mode less). Once the user has finished doing there thing in the form, then control is returned back to the loop and the same thing happens until the loop is finished. Please note that for my situation, the Form must be mode less. I am starting to read about threads, but am hoping that you will have a faster solution.
>
>So the loop is currently running on the main thread ? If so then how are you preventing the UI from becoming unresponsive ?
>
>Hard to suggest what might be best without knowing more about what you are trying to achieve but running the loop in a separate thread and showing the form as modal might be a good solution.....
Hello Viv,
Thank you very much for your reply.
What I am doing is indexing through a collection of classes, and each class has a property that tells me if a certain action/calibration is required. If so then I want to stop the loop, display the form corresponding to the action/calibration that is required and when finished, the form will close itself and the loop will continue. I know that this would be easy to achieve when using model forms, but what happens is that I have timer that monitors the state of the equipment and displays a message if there are any error conditions such as the serial connection being lost and I want the error message to be displayed immediately.
Maybe I don't need to use threads here?
That's about the best I can explain it, I hope this helps.
Thank you
Gary
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement