Results 1 to 5 of 5

Thread: Delete Line in text

  1. #1

    Thread Starter
    Addicted Member Stick's Avatar
    Join Date
    Aug 1999
    Location
    Iowa
    Posts
    152

    Delete Line in text

    Hey.
    How can i delete the last line in a text box.
    Thanks
    Sean

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    go backwards through the string, once you hit a chr$(13), delete everything from that index forward...

  3. #3
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    Originally posted by nemaroller
    go backwards through the string, once you hit a chr$(13), delete everything from that index forward...
    Bleh?

    Using the textbox's functions. It has a function to get how many lines there are within a textbox and then you can work from there.

    I would give you code or somehting, but I'm on the wrong computer, if I'm on later and no one has helped you maybe I can throw something together

  4. #4

    Thread Starter
    Addicted Member Stick's Avatar
    Join Date
    Aug 1999
    Location
    Iowa
    Posts
    152

    sounds great.

    Yeah if you could when you get a chance that would be great!!.
    Thanks
    Sean

  5. #5
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    I was unaware of the Lines member of the Textbox... obviously, that would be alot easier for lines under 5,000 long...
    VB Code:
    1. If TextBox1.Lines.Length > 0 Then
    2.             Dim r(TextBox1.Lines.Length - 2) As String
    3.             Array.Copy(TextBox1.Lines, r, r.Length)
    4.             Array.Clear(TextBox1.Lines, 0, TextBox1.Lines.Length)
    5.             TextBox1.Lines = r
    6.         End If
    Last edited by nemaroller; Aug 24th, 2003 at 06:29 PM.

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