I have overridden ProcessCmdKey in a form having this code:
if (keyData == Keys.Tab)
{
return true;
}
return base.ProcessCmdKey(ref msg, keyData);
In listview_KeyUp:
if (e.KeyCode == Keys.Tab && !e.Alt)
{
treeview.Focus();
}
In treeview_KeyUp:
if (e.KeyCode == Keys.Tab && !e.Alt)
{
listview.Focus();
}
Now, the focus is on listview,
when the application is inactive/minimized,
and alt+tab key is pressed quickly,
the application is now active but the focus
is now at treeview.
It seems when I pressed alt+tab quickly, I released tab last
and based on the code it should focus treeview.
But I don't want this behavior.
I tried the procedure with windows explorer.
It didn't switch to the next tabstop
I want this behavior.
How do I program it like windows explorer?
if (keyData == Keys.Tab)
{
return true;
}
return base.ProcessCmdKey(ref msg, keyData);
In listview_KeyUp:
if (e.KeyCode == Keys.Tab && !e.Alt)
{
treeview.Focus();
}
In treeview_KeyUp:
if (e.KeyCode == Keys.Tab && !e.Alt)
{
listview.Focus();
}
Now, the focus is on listview,
when the application is inactive/minimized,
and alt+tab key is pressed quickly,
the application is now active but the focus
is now at treeview.
It seems when I pressed alt+tab quickly, I released tab last
and based on the code it should focus treeview.
But I don't want this behavior.
I tried the procedure with windows explorer.
It didn't switch to the next tabstop
I want this behavior.
How do I program it like windows explorer?