Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Am trying in Vb.net...not getting proper solution for this pls help me
Posted

This is not easy: you have to provide global hooks as the sequence is recognised at the system level, not at application level. You will probably also have to disable CTRL+ALT+DEL, CTRL+SHIFT+TAB, and a couple of others as well.

Assuming this isn't a malicious program - and if it is you can go elsewhere - that is a very, very poor idea in modern apps: if your app did that to me I would uninstall it with extreme prejudice and demand my money back!

I would suggest that instead of trying that you look at Kiosk Mode[^] instead: it's meant for single-application computers.
 
Share this answer
 
Hello,

There are many ways to achieve this.

The simplest way is to create a new class that inherits from Form and override the method ProcessCmdKey
When the Ctrl-tab keystroke is captured you need to return False to stop it.

Public Class MyForm
    Inherits Form

    Protected Overrides Function ProcessCmdKey( _
        ByRef msg As Message, _
        ByVal keyData As Keys) As Boolean

        Const WM_KEYDOWN As Integer = &H100
        Const WM_SYSKEYDOWN As Integer = &H104

        If ((msg.Msg = WM_KEYDOWN) Or (msg.Msg = WM_SYSKEYDOWN)) Then
            Select Case (keyData)
                Case (Keys.Control Or Keys.Tab)
                    ' <CTRL> + <TAB> captured
                    Return False
            End Select
        End If

        Return MyBase.ProcessCmdKey(msg, keyData)
    End Function

End Class


Then use this class as the base of your MDI parent window instead of System.Windows.Form

VB
Partial Class MdiParent
    Inherits MyForm



Valery.
 
Share this answer
 
Comments
Valery Possoz 30-Aug-14 5:14am    
Why did someone downvote my answer? An explanation would be nice...

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900