S
spit.respectable
I'm porting a Pocket PC app to SmartPhone. Certain forms within the
app contain buttons -- these are not supported on SP so I've switch
them to LinkLabels. They work fine, but the issue is that overriding
the back button does not work on these forms.
For handling the SP back button, my keypress method looks like:
protected override void OnKeyPress(KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Escape)
{
e.Handled = true;
MessageBox.Show("Got back key on SP");
}
else
base.OnKeyPress(e);
}
This works great, unless I add the following to the form's
InitializeComponent():
this.Controls.Add( new System.Windows.Forms.LinkLabel() );
Now when I press the SP's back key my 'OnKeyPress' does not fire, and
the app is no longer displayed on the screen (i.e. the default SP back
key behavior).
Has anyone worked around this before? I did a quick search and didn't
see any obvious hits.
Thanks,
app contain buttons -- these are not supported on SP so I've switch
them to LinkLabels. They work fine, but the issue is that overriding
the back button does not work on these forms.
For handling the SP back button, my keypress method looks like:
protected override void OnKeyPress(KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Escape)
{
e.Handled = true;
MessageBox.Show("Got back key on SP");
}
else
base.OnKeyPress(e);
}
This works great, unless I add the following to the form's
InitializeComponent():
this.Controls.Add( new System.Windows.Forms.LinkLabel() );
Now when I press the SP's back key my 'OnKeyPress' does not fire, and
the app is no longer displayed on the screen (i.e. the default SP back
key behavior).
Has anyone worked around this before? I did a quick search and didn't
see any obvious hits.
Thanks,