Get char at position in textBox

This is a discussion on Get char at position in textBox within the C# Programming forums, part of the General Programming Boards category; This code tells what position the cursor is in a textbox. Let us say that this position is 10. Now ...

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

    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
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    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
    383
    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, 11:36 AM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21