List Box (TTMSFNCListBox) and Keyboard Events

Does TTMSFNCListBox Events "OnKeyPress", "OnKeyDown" not work?

I have a window with only one list box in it and I want to control the form with the keyboard. On enter I want to select the item and on ESC I want to close it.
But no keyboard events arrive. Everything is fine with the mouse.
I absolutely need the keyboard.

What can I do?

When I debug the source, I jump into code from treeview. Is that right?

procedure TTMSFNCCustomTreeView.HandleKeyDown(var Key: Word; Shift: TShiftState);

the listbox uses a TTMSFNCTreeView internally. The events are not redirected. I'll investigate here what we can do about that, for now ,you can use TMSFNCListBox1.TreeView.OnKeyDown

Ok,
That's enough for me. The main thing is that I get the KeyPress. It works like this.
Thank you

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.