I made a form for creating a new solution and a new version. There is a close button. I can't find a way how to do it. I need when the cancel button is clicked the operation to be stopped and the form to close
Loading
I made a form for creating a new solution and a new version. There is a close button. I can't find a way how to do it. I need when the cancel button is clicked the operation to be stopped and the form to close
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
vivek kulkarni18 reputationPosted Dec 15, 2021, 11:39 AM EST
Rositsa RusevaRank #5,080 · 312 reputationPosted Dec 17, 2021, 4:41 AM EST
Rositsa RusevaRank #5,080 · 312 reputationPosted Dec 17, 2021, 5:20 AM EST
This is what I've been trying to do:
https://pastebin.com/WdXpBAVe
Sachin SinghRank #66 · 26.2K reputationPosted Dec 17, 2021, 5:46 AM EST
Rositsa RusevaRank #5,080 · 312 reputationPosted Dec 17, 2021, 5:59 AM EST
Yazhini MP128 reputationPosted Dec 15, 2021, 11:53 PM EST
The app will close when the main form is closed. You can try the following in your form's Cancel button event handler:
this.Close();
You can also set this. DialogResult property to false. The form will close as a result of this.
In any case, make sure your code is processing according to which button was used to close the form if you're also handling the Close event.