DocumentView Eventsink KeyDown Doesn't Catch Tab?


Author
Message
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi Jason,

In a windows application the tab key has a special meaning – usually it moves the focus to the next control, but the KeyDown event of a control occurs only when the control has the focus. That’s why the key down of the Tab key never gets registered.

 

What you can do is to use a standard WinForm programming technique (it event doesn’t have anything to do with the diagram) - override the ProcessCmdKey method of the Form. For example:

 

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)

{

      if (keyData == Keys.Tab)

      {

            //

            // Do what you want here - the tab key was pressed...

            //

 

            // Return true to say that the key stroke is processed

            return true;

      }

 

      return base.ProcessCmdKey(ref msg, keyData);

}



Best Regards,
Nevron Support Team


Jason Irby
Jason Irby
Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)
Group: Forum Members
Posts: 59, Visits: 77

 

I'd like to catch the tab key while the user is in the diagram view and override its normal behavior.

I have registered for the view keydown event and it seems to work fine with the exception of the tab key.

Tab never makes it down to the event. All other keys seem to.

What am I doing wrong?

 

Thanks in advance,

Jason

 

 

 

 

 

 


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search