all groups > dotnet compact framework > april 2007 >
You're in the

dotnet compact framework

group:

Opening main menu with soft keys


Opening main menu with soft keys Malleswar
4/30/2007 3:44:27 AM
dotnet compact framework: Hi Friends,

I am using menu in my form. By taping on menu I can be able to
open it. It comes by default. But here by using softkeys on key board
I want to open the menu. Can u one tell me how proceed for this?


Thanks in Advance,
Re: Opening main menu with soft keys Chris Craft
5/1/2007 7:59:36 PM
Hi,

The easiest way is to make sure you are working with the Windows Mobile 5.0
SDK. For example in Visual Studio 2005, use Visual C#, and Smart Device, and
Windows Mobile 5.0 Pocket PC, and Device Application. By default a form with
a menu that supports soft keys is created.

The following article may help.

Controls_: using the soft keys for a Sudoku solver app
http://netcf2.blogspot.com/2005/11/controls-using-soft-keys-for-sudoku.html

Windows Mobile 5.0 SDK for Pocket PC
http://www.microsoft.com/downloads/details.aspx?familyid=83A52AF2-F524-4EC5-9155-717CBE5D25ED&displaylang=en

If you would like to support hard keys as well you could code that part
yourself:

private void menuItem1_Click(object sender, EventArgs e)
{
// your code here
}

private void Form1_KeyPress(object sender, KeyPressEventArgs e)
{
menuItem1_Click(this, new EventArgs());
}

Or you could just refactor the code:

private void menuItem1_Click(object sender, EventArgs e)
{
NewMethod();
}

private void Form1_KeyPress(object sender, KeyPressEventArgs e)
{
NewMethod();
}

private void NewMethod()
{
// your code here
}

hope that helps,
Chris Craft
http://www.cjcraft.com/blog/


[quoted text, click to view]
AddThis Social Bookmark Button