Profile Picture

DocumentView Eventsink KeyDown Doesn't Catch Tab?

Posted By Jason Irby 14 Years Ago
Author
Message
Jason Irby
Posted 14 Years Ago
View Quick Profile
Forum Member

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
Last Active: 3 Years Ago
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

 

 

 

 

 

 



Nevron Support
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

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





Similar Topics


Reading This Topic