views:

1440

answers:

2

Hi,

does anybody know if it is possible to use the softkeys on a WM 6 device (Motorola MC 35) without actually displaying the bottom bar / menu bar? I have a full screen Compact Framework app where I want to use the soft keys but I do not want the bottom menu bar displayed (would be a waste of screen space). Unfortunately the soft keys do not seem to generate any keyboard event!?

It would also be fine with me to generally remap the soft keys to some standard keys, e.g. F1 and F2, may be there is some hack or registry tweak for this?

Thanks.

+1  A: 

Ironically I think that MS calls these hardware buttons, maybe that was a problem when googling. There is a Hardwarekey component, set it's Key property (Key1 .. 5) and redirect it to a Control. That control can be your Form. In the Controls KeyDown event typecast the KeyCode to the Hardwarekeys enum.

See the sample code on this MSDN page.

Henk Holterman
Thanks a lot. I indeed google'd for about an hour without any usable result, using "softkeys" as search parameter...
Timo
+1  A: 

I don't think you can "not" have menu bar if you want to use the keys, but you can "hide" the menu bar window just like any window.

e.g.

ShowWindow(SHFindMenuBar(window_handle), SW_HIDE);

One problem you will have is that some devices do not have hardware buttons for the softkeys so hiding them will mean the user can't use them.

Shane Powell
Or you can just set the Form.MainMenu property to null
Henk Holterman
Thanks Henk, I'm more of a native guy so I don't know much about the .net CF world.
Shane Powell