Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 16th, 2006, 01:12 PM
Authorized User
 
Join Date: Apr 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default Tab to next textbox

Hello. I have four textboxes, each with a maximum length of three. I was wondering how I could have the software automatically move to the next text box once three characters were entered into the textbox (similar to when you are entering a license key in a program). Thanks in advance.

Computers will never surpass the human brain; no computer will ever be able to replicate human stupidity.
__________________
If only computers could write programs themselves...
 
Old August 8th, 2006, 06:50 AM
Authorized User
 
Join Date: Aug 2005
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You Write a Client Side validation code either in Java Script /Vb Script in Onchange event of Text Box.

Regards
Adalarasu
XYKA Software
Bangalore

 
Old August 11th, 2006, 12:02 AM
Authorized User
 
Join Date: Apr 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I guess I should have been more specific; tbis is a windows form application, not a web application.

Also, I know that these are the steps to take, I just don't know how to take them!

Computers will never surpass the human brain; no computer will ever be able to replicate human stupidity.
 
Old August 17th, 2006, 12:11 PM
Authorized User
 
Join Date: Apr 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Set a maxlength for your first textbox for instance 3...

Then set focus for the next textbox in your first textbox TextChanged event:

textBox1.MaxLength = 3;
...
...
private void textBox1_TextChanged(object sender, System.EventArgs e)
{
if(textBox1.Text.Length == 3)
    textBox2.Focus();
}

 
Old August 18th, 2006, 10:46 AM
Authorized User
 
Join Date: Apr 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank-you. The Focus() method is exactly what I needed!

Computers will never surpass the human brain; no computer will ever be able to replicate human stupidity.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to disable a tab on a tab control. dbradley VB.NET 6 April 14th, 2011 10:04 AM
Tab across gridviews cdw90nl Javascript How-To 1 February 4th, 2008 05:16 AM
pointing cursor from one textbox to other textbox lakshmi_annayappa ASP.NET 1.0 and 1.1 Basics 2 August 2nd, 2007 03:41 PM
how to many textbox jump by tab in order? richie86 ASP.NET 1.0 and 1.1 Basics 3 December 11th, 2005 04:29 PM
Masked TextBox & formatting TextBox melvik C# 1 September 22nd, 2003 11:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.