Home > Net >  How elegant winform wait
How elegant winform wait

Time:01-03

When click on the button will perform a series of lengthy operations, most is to query the database and display content
Such as the three grid

Click the button to refresh a due to refresh the triggered refresh b b refresh triggered c refresh

The three refresh are asynchronous is not blocking the interface that is to say, the user can click on the button again and then continue to refresh

In order to solve the problem of refresh many times I've created a form of the size of the transparent panel on top

My code up a function in the creation process in the form of a call every time refresh

Three times but will create a panel is not accidental but not what I want

Ideal should be to have a similar thread pool as the object of management panel,

Register with each operation with a thread pool thread

When all of the threads at the end of the delete panel but helpless technology very vegetables, every brother please help

CodePudding user response:

Each form, the panel singleton

CodePudding user response:

Single cannot solve the singleton will only cause after the end of the first thread will remove the panel

CodePudding user response:

What do you want to delete, you have a form, showdialog is bad?

refer to the second floor qq_30335331 response:
single cannot solve the singleton will only cause after the end of the first thread will delete the panel

CodePudding user response:

Click on the button will button disabled is not good, to restore all the task has been completed
  •  Tags:  
  • C#
  • Related