Hi Lisa,
Based on my understanding, you have a WinForm application which contains an
MDI parent and several MDI child forms. On one MDI child form, there're
several TextBox and a Button. The users could press the Enter key to
navigate through the TextBox on the MDI child form. The problem is that
when the focus is on the button, and the user press Ctrl+Tab to switch to
another MDI child form, and then switch back to the previous MDI child
form, the Enter key won't work for navigation any more. If I'm off base,
please feel free to let me know.
I performed a test based on your description, but didn't reproduce the
problem on my side.
The following is the code to navigate through the TextBox controls on the
MDI child form in my test.
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
this.textBox1.KeyUp += new KeyEventHandler(control_KeyUp);
this.textBox2.KeyUp += new KeyEventHandler(control_KeyUp);
this.textBox3.KeyUp += new KeyEventHandler(control_KeyUp);
this.textBox4.KeyUp += new KeyEventHandler(control_KeyUp);
this.button1.KeyUp += new KeyEventHandler(control_KeyUp);
}
void control_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
this.SelectNextControl(sender as Control, true, true,
false, true);
}
}
}
Is there any difference between your project and mine? If the problem is
still not solved, you may send me a sample project that could just
reproduce the problem. To get my actual email address, remove 'online' from
my displayed email address.
Sincerely,
Linda Liu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.