Thread: Get char at position in textBox

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    385

    Get char at position in textBox

    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 ?


    Code:
    int position;
    position = textBox1->SelectionStart;

  2. #2
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    Quote Originally Posted by Coding View Post
    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 ?


    Code:
    int position;
    position = textBox1->SelectionStart;
    textBox1.Text[9] will return a char with the value of the character in position 9.
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    385
    thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ ini file reader problems
    By guitarist809 in forum C++ Programming
    Replies: 7
    Last Post: 09-04-2008, 06:02 AM
  2. Sorting Linked Lists
    By DKING89 in forum C Programming
    Replies: 6
    Last Post: 04-09-2008, 07:36 AM
  3. Need help understanding info in a header file
    By hicpics in forum C Programming
    Replies: 8
    Last Post: 12-02-2005, 12:36 PM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM