1
I’m having some problems with an application I created, using C#
and Windows Forms
, and the situation is as follows::
- The app is a chat. It does not keep record of conversations;
- When the application is closed I request a confirmation for closure stating that all converse content will be lost;
- Chat stays active on Tray until the user tries to close it by left-clicking on the icon;
When the user tries to turn off the PC without before turning off the chat windows is always on the screen "Preparing to finish", waiting for the end of the pending processes and never leaves this screen without the user "Force" the termination.
I believe this behavior occurs due to this confirmation message that blocks the thread
.
What I wish to do is something like:
Request confirmation, but if the user does not respond within 30 seconds, for example, the confirmation is automatically closed and the application closes.
But when using the MessageBox.Show()
the user should always respond to terminate the process.
I thought about developing a form to make this notification, but I don’t know how to simulate the behavior of MessageBox.Show()
blocking the thread
UI and still check a timer
to see if time has passed.
Any help that leads me to achieve my goal and make users more "Happy" will be very welcome.
See help: http://answall.com/questions/50873/como-fa%C3%A7o-para-fechar-encerrar-um-msgbox-via-c%C3%B3digo/50878#50878
– rubStackOverflow
I will test, but I believe it will meet my need. VLW
– Richard Dias
@Hstackoverflow Post your comment as response.
– PauloHDSousa
Thank you @Paulohdsousa, if you solve his problem I think it is better to evaluate the answer (from the link) otherwise it is repetitive. Even so if the author finds the answer (of the comment) useful I can change.
– rubStackOverflow