CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2009
    Posts
    2

    Question How to interrupt parent event

    Hello I need custom KeyDown event service, viz I need other processing (not lost focus) in TextBox for Tab Key.
    In MFC C++ this problem resolved by PreTranslateMessage procedure.
    How to do this in c#? Help me :'(

  2. #2
    Join Date
    May 2004
    Location
    Osijek
    Posts
    61

    Re: How to interrupt parent event

    Override ProcessCmdKey.
    Code:
    protected override bool ProcessCmdKey(ref Message msg, Keys keyData) {
        if (keyData == Keys.Tab) {
            this.Text = "TAB";
            return true;
        }
        return base.ProcessCmdKey(ref msg, keyData);
    }

  3. #3
    Join Date
    Feb 2009
    Posts
    2

    Smile Re: How to interrupt parent event

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured