StrataFrame Forum

end of textbox with enter or tab

http://forum.strataframe.net/Topic17557.aspx

By Eric Leissler - 7/2/2008

Hi,
So excuse me its my last question for today.

in a simple form i have to corlorizedtexbox

when the cursor is on login colorizedtexbox, if user type [tab], the cursor go in pasword colorizedtextbox
but if user type [ENTER], the cursor  rest in login zone.

How make for  moving the cursor from login zone to paswword zone with the [ENTRE] KEY on the keyboard.

Thank's

Eric

By Trent L. Taylor - 7/2/2008

You really shouldn't be using a ColorizedTextBox as this control has been deprecated and actually the control taking it's place is the new SyntaxEditor.  The ColorizedTextBox is nothing more than a RTF with additional logic...the SyntaxEditor control goes a lot further, but in either case, you should be using a different control.

You should be using a TextBox or MaskedTextbox for this type of data entry as they are might lighter weight and this is the type of area for which they are inteded versus an RTF control.

By Eric Leissler - 7/2/2008

well,

I try with a texbox, but it's the same problem.
i woud to valid my texbox with enter key. How can i do ??

Thank's

By Trent L. Taylor - 7/2/2008

Sorry, I focused on the ColorizedTextBox versus the Enter problem.  Windows standard uses a Tab versus a Enter.  So to implement an Enter, you can implement this logic yourself by inheriting the StrataFrame texbox ( or any textbox for that matter) and then override the ProcessCmdKey method and check for the Enter.  If the enter was pressed, then you would just call the SelectNext method on the textbox.

This related to standard .NET over StrataFrame, but maybe this will get you pointed in the right direction.

By Eric Leissler - 7/2/2008

hi,

thank's, i made this code in keypress method

Private Sub Textbox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Textbox1.KeyPress

If e.KeyChar = Chr(13) Then

Me.Textbox2.Focus()

End If

End Sub

At running, it's ok.

very thanks
it'all for today , it one hour of mornig here in France.
Have a good day

It's time to sleep for me.

Eric