In Framework 4.0, I have a WinForm that is opened from another form, displays some stuff and a progress bar, and then sits there. I would like to close that “pop up” form after n secods if the user does not close it manually. What’s the smartest way to do that?
Thanks.
Start a timer with the desired interval and then when it ticks the first time, close the form.
Something like this
Actually the smartest way would probably putting this in its own StartCountdown() method that takes the time as a parameter. Logic like this normally shouldn’t be in a constructor strictly speaking…