Hi Dave,
Based on my understanding, you are trying to navigate through the textbox
controls on your form by hitting Enter continuously. It works fine on all
textbox except one textbox, i.e. txtAdd2. When the txtAdd2 gets focused and
you press Enter, an exception of type 'System.NullReferenceException'
occurs. The txtAdd2 passes Nothing to the KeyPress event handler.
If I have any misunderstanding, please feel free to correct me.
I have performed a test based on your description, but I couldn't reproduce
the problem. I have a try setting the TabStop property one textbox on my
form to False. When the program is run and I hit Enter continuously, all
the TextBox except the one whose TabStop property is set to False get
focused in order. There's no any problem.
Is the 'txtAdd2' of type TextBox? Do you have any special process on
txtAdd2? If possible, could you please send me your sample project that
could just reproduce the problem? To get my actual email address, remove
'online' from my displayed email address.
I look forward to your reply.
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.