Reputation: 6437
I have a TreeView in my form for which I dont want to have key input enabled. Which means that if I have this tree structure:
Root
|
-- Abba
|
-- Basic
|
-- Center
...and press b key. I do not want "Basic" to be selected. I only want the user to be able to select nodes using mouse input.
Any ideas on how to achieve this?
Upvotes: 1
Views: 1527
Reputation: 6498
in key press event of tree view
if(Char.IsDigit(e.KeyChar) || Char.IsLetter(e.KeyChar))
{
e.Handled = true;
}
Upvotes: 3
Reputation: 24395
First thought: You could overload the OnKey* events to do nothing.
Upvotes: 0