Window hav to close while pressing enter, but it is redirecting to next page. provide a solution
To Close A Window While Pressing ENTER button
5 Answers
Know the answer? Post it. Somebody with the same question will find it here.
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
Abhijit PatilRank #700 · 3.4K reputationPosted Feb 26, 2014, 9:31 PM EST
write the below code of keypress event.
if(e.KeyChar=Keys.Enter)
{
This.Close();
}
Hope it help you
Regards,
Abhijti patil
dotnetbyabhipatil.blogspot.in
Bala Murugan143 reputationPosted Feb 26, 2014, 10:15 PM EST
Abhijit PatilRank #700 · 3.4K reputationPosted Feb 26, 2014, 11:00 PM EST
you can write same code in key up event
hope it work.
Bala Murugan143 reputationPosted Feb 27, 2014, 12:12 AM EST
Lakshmanan Sethu SankaranarayanRank #124 · 17.7K reputationPosted Feb 27, 2014, 12:16 AM EST