Results 1 to 4 of 4

Thread: Inserting text

  1. #1

    Thread Starter
    Hyperactive Member demon.KILER's Avatar
    Join Date
    Jul 2006
    Location
    I cannot remember !?
    Posts
    408

    Resolved Inserting text

    hi every one


    i need to know how to instert a text in the position of the cursor (not the mouse cursor (the blicking one that appears when we type))
    Last edited by demon.KILER; Sep 11th, 2006 at 05:59 PM.
    VS 2005 .....Framework SDK 3.0

    "Its mostly the brave one who choose to not fight"

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,350

    Re: Inserting text

    I assume that you mean in a TextBox, and what you're talking about is called the "caret". To insert text at the caret position in a TextBox or RichTextBox you simply set the SelectedText property. If text is selected it will be replaced. If no text is selected then the new text is simply inserted.

  3. #3
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Inserting text

    And if you don't wont text to be replaced if highlighted put
    VB Code:
    1. TextBox1.SelectionLength = 0
    before setting the "SelectedText" value
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  4. #4

    Thread Starter
    Hyperactive Member demon.KILER's Avatar
    Join Date
    Jul 2006
    Location
    I cannot remember !?
    Posts
    408

    Re: Inserting text

    ohhh ! thx

    I never thought it would be that easy

    you're talking about is called the "caret"
    thx for the info
    VS 2005 .....Framework SDK 3.0

    "Its mostly the brave one who choose to not fight"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width