Search code examples
.netpanelwndproc

Not receiving WM_KEYDOWN message in a Panel's overloaded WndProc?


I am receiving other types of messages, so I know the overloaded method is being called.

The only info I have found from searching talks about needing to give my Panel focus so that it can receive inputs. However, that solution did not help anything. (http://www.dotnet247.com/247reference/msgs/44/221762.aspx)

Any help would be appreciated :)


Solution

  • So the problem was related to the Panel not having focus.

    A Panel (and some other types of controls) can not receive certain types of inputs because it can not receive proper focus.

    I just changed the type from a Panel to a Button and things worked.

    This was acceptable for me since I am only using this control as a tick/render surface anyways.