Andrus,
You say you overrode the OnKeyPress, but then you showed code for the ProcessCmdKey ... are you saying that you tried that instead? And did it work?
It should work, but you don't show your "custom processing". Here's what I did that works. This code belongs in the MdiParent, not the MdiChild:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
switch (keyData)
{
case Keys.Control | Keys.F1:
case Keys.Control | Keys.Tab:
for (int i = 0; i < this.MdiChildren.Length; i++)
{
if (this.MdiChildren[i].Equals(this.ActiveMdiChild))
{
i++;
if (i == this.MdiChildren.Length)
i = 0;
this.ActivateMdiChild(this.MdiChildren[i]);
this.ActiveMdiChild.Activate();
break;
}
}
return true;
}
return base.ProcessCmdKey(ref msg, keyData);
}
~~Bonnie
>MDI WinForms 2 application.
>I need that Ctrl+F1 cycles through windows like in VFP.
>
>I overrided MDI child form OnKeypress method but Ctrl+F1 press is ignored.
>
>How to force Ctrl+F1 to cycle between windows ?
>
>
>Andrus.
>
>protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
>{
> switch (keyData)
> {
> case Keys.Control | Keys.Tab:
> // ... custom processing occurs hear.
> return true;
>
> case Keys.Control | Keys.F1:
> keyData = Keys.Control | Keys.Tab ;
> break;
> }
> return base.ProcessCmdKey(ref msg, keyData);
>}