问题
I have a Windows Mobile application developed with Visual Studio 2008 and C# (Smart Device Project). When I run the application there's a start menu bar visible on the top and keyboard bar on the bottom. How can I make my application run in full-screen mode?
If possible I would like to have a solution that will allow me to turn full-screen mode on and off on runtime (after clicking some form button for example).
回答1:
Getting rid of the keyboard/menu bar at the bottom is easy: just remove the MainMenu control from each of your forms.
Getting rid of the start menu (aka task bar) at the top of the screen is more difficult, and requires using the Windows API. This link shows how to do it.
There is a simpler way to make your application full-screen (sorry, it's early and I don't remember it right now), but the simpler method has an ugly side effect where the task bar momentarily reappears when you switch to another form in your application, which kind of kills the desired kiosk effect. Using the API as above to hide the task bar prevents this from happening.
However, there is a danger to this approach: if your application exits or crashes without having un-hidden the task bar, your user will have no way of unhiding it, and it will remain invisible until the device is reset.
回答2:
Check Microsoft's example.
While example is for Windows Mobile 2003, you can pick syntax of SHFullScreen call from there. Here is already extracted call with example.
回答3:
Try this on your main form; it might help:
this.WindowState = FormWindowState.Maximized;
回答4:
I tested on Windows Mobile 6 Professional VGA emulator, it works. The keyboard button is missed too.
this.WindowState = FormWindowState.Maximized;
this.Menu = null;
this.ControlBox = false;
来源:https://stackoverflow.com/questions/1287173/windows-mobile-application-in-full-screen-mode