I did something vague where I wanted to process a WM_EXITMENULOOP message that was not available as an event in .NETCF.
The solution was to “subclass” the main menu, the old MFC trick, in which you replaced the WndProc function with your own, process any Windows messages (WM_EXITMENULOOP in my case), and call the WndProc base class for everything else.
Alex Yakhnin's blog post has some code examples on how to subclass a control: An example of subclassing a window in .NETCF
In your case, you will actually subclass the form that MainMenu is on, and I think WM_DRAWITEM will be the Windows message that you want to process yourself. I have not tried changing the background color myself, so I'm not completely sure that this will work, but the subclass should have started.
source share