Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable CTRL-N

Status
Not open for further replies.

Beau71

MIS
Joined
Jul 18, 2006
Messages
87
Location
US
Does anyone know a way to Override the CTRL-N keystroke in VB .NET 2003? I have created a custom web browser that only allows user to go to one site. However, if they press CTRL-N a new IE window will open up allowing them to surf the web.

 
Have you tried handling the keys related events (e.g KeyPressed)?
 
No I haven't. I am not a programmer, just kind of thrown into the position since I did some programming back in school. How would I do that fawkes?
 
Create a keylistener on the form. if keypressed = CTRL+N then EXIT/RETURN else go ahead

-The answer to your problem may not be the answer to your question.
 
What would the code for that be?
 
In the forms properties, set Key Previes to TRUE

then create a event for the Keyup :
Code:
 Private Sub Form1_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp
        If e.KeyCode = Keys.Control And e.KeyCode = Keys.N Then
            Exit Sub
        End If
    End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top