Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hello

 

I have a little code to change a '.' into a ','.

But after the changing the cursor is put to the beginning of the textfield.

 

Before:

 

45.|

after translation:

|45,

 

The | is the cursor.

 

My code: txtPrijs.Text = txtPrijs.Text.Replace(".", ",");

 

I like to put the cursor tot the end of the line..

But how?

Posted

Assume there's a form with a textbox and a button. In the button's click event, put the following code...

 

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
       Me.TextBox2.Focus()
       Me.TextBox2.Text = "superfly crazy!!"
       Me.TextBox2.Select(Me.TextBox2.Text.Length, Me.TextBox2.Text.Length)  '' <------- The important line for you.
   End Sub

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...