1
Hello, I am developing a C# software to help in the scanning of old photos, and in the middle of one of the algorithms to process the images, I want the cursor to change to the loading mode so that the user knows when the system is processing.
What I did was insert this way right at the beginning of the function:
this.Cursor = Cursors.Wait;
int count = 0;
int n = System.IO.Directory.GetFiles(path, "*.jpg", System.IO.SearchOption.AllDirectories).Length;
foreach (string file in System.IO.Directory.GetFiles(path, "*.jpg", System.IO.SearchOption.AllDirectories))
{
MotherImage mImage = new MotherImage(file);
mImage.targetImage.CalculateDataIntensity();
mImage.CreateMap();
...
The only thing is that I get this error message from Visual Studio:
Error message:
An Exception of type 'System.Invalidoperationexception' occurred in Windowsbase.dll but was not handled in user code
Details of the error:
{Function Evaluation disabled because a Previous Function Evaluation timed out. You must continue Execution to reenable Function Evaluation.}
Is the command wrong? Any idea how to proceed?
With this code you can not see any error. Post where the error actually occurs.
– Maniero
Sorry, the error comes directly from line "this. Cursor = Cursors.Wait;"
– Rafael Savi
What technology are you using?
– Maniero
What do you mean, technology? For interface? It’s C# WPF
– Rafael Savi