Get char at position in textBox [Archive] - C Board

PDA

View Full Version : Get char at position in textBox


Coding
03-19-2008, 08:17 PM
This code tells what position the cursor is in a textbox.
Let us say that this position is 10.

Now is my question, is it possible to know what character it is if any on position 9 in the textBox.
Is it possible to put the character on position 9 to a string ?



int position;
position = textBox1->SelectionStart;

Cat
03-19-2008, 08:42 PM
This code tells what position the cursor is in a textbox.
Let us say that this position is 10.

Now is my question, is it possible to know what character it is if any on position 9 in the textBox.
Is it possible to put the character on position 9 to a string ?



int position;
position = textBox1->SelectionStart;


textBox1.Text[9] will return a char with the value of the character in position 9.

Coding
03-20-2008, 09:12 AM
thanks.