Andreas,
First I am assuming you have a form with at least one or more TextBox's and
with the SIP raised. Catching the ENTER key is something I do to move the
cursor to the next TextBox. To do this, use the KeyPress event associated
with each TextBox and map it to an event handler. Here is an example of my
handler code:
public static void NextOnEnter(object obj, KeyPressEventArgs e)
{
// Trap ENTER key and change focus to next TextBox control
if (e.KeyChar == 13)
{
int i;
int ii = 0;
TextBox txb = (TextBox) obj; // Get the TextBox control from
object
Control control = txb.Parent; // Get the Parent control
i = control.Controls.IndexOf(txb); // Get the position of this
TextBox control in the collection
while (ii == 0)
{
// Increment the control number
i++;
// Check if last control reached. If so, set back to first one.
if (i == control.Controls.Count)
{
i = 0;
}
// Check if this control is a TextBox type. If not, keep
incrementing.
if (control.Controls
.GetType().Name == "TextBox")
{
ii = 1;
}
}
// Set focus to the next TextBox control in sequence
control.Controls.Focus()
}
}
Regards,
Neville Lang
Hi,
in my PPC application I want to catch the event when the "return" key is
pressed on the SIP. Does anyone know how to do this?
Thanks
Andreas