Click here to Skip to main content
13,051,413 members (46,303 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi friends
i write a code like

Private Sub flash_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
    If e.KeyCode = Keys.Escape Then
    End If
End Sub

In the code is work.But when i drag and drop the shack wave flash object control on form designing after i run the form the above code does not work.How can i rectify this problem???
Advance thanks to all.....
Posted 5-Nov-12 7:47am
Updated 5-Nov-12 7:56am
"Does not work" is not informative enough. What exactly the problem is? And what is "Me" here? A form? Why closing it in this strange way? If this is a modal window, it's closed by itself; you need to have CancelButton.
SPprasath 5-Nov-12 14:01pm
Thank u....
You are welcome.
If you agree that my answer makes sense, please accept it formally (green button) -- thanks.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This is not a good way to close a window. If you show a window as modal (via ShowDialog), you need to use CancelButton; and the form will close itself on escape:[^].

And if the form is not modal, you should never close it with Escape, as it will violated expected UI style and can cause loss of user's work, by apparent reasons.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 5 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100