View Single Post
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Removing First Line Of Text From multiline textbox

 
0
  #4
Aug 26th, 2008
1) Drag a text box onto your form. Make sure the multiline option is true
2) Drag a button onto your form

  1. Imports System.io
  2.  
  3. Public Class Form1
  4.  
  5. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  6.  
  7. 'read in file
  8. Dim objReader As New StreamReader("C:\test.txt")
  9.  
  10. Dim sLine As String = ""
  11.  
  12. Dim lineCounter As Integer = 0
  13.  
  14. Do
  15.  
  16. sLine = objReader.ReadLine()
  17. If lineCounter > 0 Then
  18. TextBox1.Text = TextBox1.Text + sLine + System.Environment.NewLine
  19.  
  20. End If
  21. lineCounter = lineCounter + 1
  22.  
  23. Loop Until sLine Is Nothing
  24.  
  25. objReader.Close()
  26.  
  27. End Sub
  28. End Class
Last edited by iamthwee; Aug 26th, 2008 at 8:12 am.
*Voted best profile in the world*
Reply With Quote