csharp winforms textbox cursor position

Code Example - csharp winforms textbox cursor position

                
                        //If you want to put the cusror at the end of text use this:
TextBox1.SelectionStart = TextBox1.Text.Length;
TextBox1.SelectionLength = 0;
// Or use this for custom location int CustomIndex 
TextBox1.SelectionStart = CustomIndex;
TextBox1.SelectionLength = 0;