What's the equivalent of calling Activity.finish() in a WinForms application?
-
02-01-2020 - |
Question
In Android when finished with an Activity and want to return to previous activity you use finish();
.
Is there an equivalent in WinForms using C#? In my application once the user clicks the Enter
button I want the user to return to previous window.
Solution
Base on a superficial understanding of an Activity in Android (sounds like a window element), you just need to call Close
on the current window, then the previous one will then move to the foreground.
For future reference however, I would advise you not too create such analogies between two radically different technologies since the life cycle of an Activity in Android is radically different from a form in a Windows Form application. You should try to learn the framework rather than replicating an implementation from a different framework/platform.