Alright this is reallly stumping me and rather aggravating.

Long story short, I didn't like how the ListView worked in C#, so I decided it was time to build my own, using a TableLayoutPanel and a custom control I built to emulate the image and text effect. Well while testing I noticed I could navigate the TableLayoutPanel with my keys, but the I didn't like the logic behind it. So I decided I was going to use the Key events for the TableLayoutPanel ... that was until I realized it pretty much has none (just the PreviewKeyDown, which pretty much isn't working).

So can someone tell me, is there ANYWAY to get some key events for the a TableLayoutPanel? Going to the MSDN page they have all the basic events, but clicking on them you'll be greated with the following

"This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

This member is not meaningful for this control."

I have been trying to scavenger the internet for an answer, but for the life of me I can't find an answer to even point me in the right direction. I can't believe I am the only one asking about. I mean the TableLayoutPanel can be navigated with keys, so there is something going on here, but I can't get access to it?

Right now I am about at the point of building a Custom Controller for the TableLayoutPanel, and hopefully I can override the key events, but let's face it, I am doubting this will even work (as I have pointed out I don't have events, so I double I can override that which I can't seem to access in the first place).

Any help would be great, this issue is rather annoying

Edited by JOSheaIV

3 Years
Discussion Span
Last Post by JOSheaIV

The TableLayoutPanel is a container control its designed to hold other controls not display text. Use textboxes, richtextboxes in the cells to handle the key presses.

Edited by tinstaafl


Thanks tinstaafl, I actually was about to overload the ProcessCmdKey function, it did the trick perfectly (it was going to be hard to assign all those keys and give them logic to know how to manuever).

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.