Hi,
I don;t remember seeing this feature in the framework, so you most probably
will have to implement it. It's easy you would have to use a KeyPress
handler (or another event that fires when a key is pressed) and check if
the length of the text vs the size, if needed move to the next.
What I would do is I would create a handler that will dynamically be
assigned to the "next" control:
This is a very basic struct, just to give you an idea:
EventHandler moveNext = new EventHandler ( TheMethod );
form_load( ... )
firstControl.KeyPress += moveNext;
void TheMethod( object sender , ... )
{
TextBox cur = (TextBox) sender;
if ( cur.Text.Lenght == cur.MaxLength )
{
cur.KeyPress -=moveNext ;
// get the next one, maybe this can be improved
foreach( Control c in Controls )
if ( c.TabIndex == cur.TabIndex+1 ) //gotcha
c.KeyPress += moveNext ;
}
}
cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Mike L" <Ca***@nospam.nospam> wrote in message
news:AE**********************************@microsof t.com...
This is for a Win form.
When the field reaches the max limit I want the cursor to go to the next
field.
Saving the user from pressing the tab key.