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

Recommended Answers

All 2 Replies

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.

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).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.