Posted 12 April 2018, 12:41 am EST
Hello Saleem,
It seems that the C1TextBox doesn’t have focus when the button is pressed. So, you can’t see the selected text or its start position.
Please set the C1TextBox’s HideSelection property to false. This will allow the TextBox’s selected text to be displayed as selected (highlighted), even if the TextBox doesn’t have focus.
c1TextBox1.HideSelection = false;
int i = c1TextBox1.SelectionStart;
string k = c1TextBox1.SelectedText;
MessageBox.Show(i.ToString() +"\n"+ k);
This should help. Let us know if you need any further assistance.
Best Regards,
Esha