Graphic Problem
-
Hi My Friends, I write a program with C#, that after clicking button OpenFileDialog appear and you can select a text file and then my program read the text file and insert into Database. This program work good and no problem but after click select and open text file in the OpenFileDialog about 2 or 3 second (depend to the size of file) below picture appear : http://www.freewebs.com/autoclinic/images/untitled.gif[^] I want to know how can prevent this action ? Best Regards, Reza Shojaee
-
Hi My Friends, I write a program with C#, that after clicking button OpenFileDialog appear and you can select a text file and then my program read the text file and insert into Database. This program work good and no problem but after click select and open text file in the OpenFileDialog about 2 or 3 second (depend to the size of file) below picture appear : http://www.freewebs.com/autoclinic/images/untitled.gif[^] I want to know how can prevent this action ? Best Regards, Reza Shojaee
Your program's UI freezes because it is busy reading txt file and inserting it into database so it has no time to repaint itself. Try moving the file processing code into a new thread.
Giorgi Dalakishvili #region signature my articles #endregion
-
Your program's UI freezes because it is busy reading txt file and inserting it into database so it has no time to repaint itself. Try moving the file processing code into a new thread.
Giorgi Dalakishvili #region signature my articles #endregion
Thanks for your guidance, If I don't want use multithread programming.Can repaint form manually before insert data into database? Best Regards, Reza Shojaee
-
Thanks for your guidance, If I don't want use multithread programming.Can repaint form manually before insert data into database? Best Regards, Reza Shojaee
Try Application.DoEvents() method
Giorgi Dalakishvili #region signature my articles #endregion
-
Try Application.DoEvents() method
Giorgi Dalakishvili #region signature my articles #endregion
Special thanks for you. my problem solved. Best Regards, Reza Shojaee