top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

how to set the “|” character to last position in textBox?

+2 votes

Hi i am little bit struct in this concept in my textbox i am using substring concept text length exceed means it select particular it works fine but my cursor move first after my substring.

posted Nov 13, 2014 by Saravanan

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

I think this is your issue
for example:

123 | a <- invalid character, my function in the _TextChanged event remove it and the position go to:

| 123

I want:

123 |

The following code will help you to solve your problem

int textLength = yourTextBox.Text.Length;
yourTextBox.SelectionStart = textLength;
yourTextBox.SelectionLength = 0;

answer Nov 17, 2014 by Jdk
Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.