Results 1 to 40 of 48

Thread: Text Boxes

Threaded View

  1. #29
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    Re: Text Boxes

    vb.net Code:
    1. Dim line_idx As Integer, line As String, Lines As String()
    2.  
    3. Dim AddedLines As New List(Of String)
    4. Dim Progress As Integer = 0
    5. Lines() = TBox.Lines
    6.  
    7.  
    8. For line_idx = 0 To Lines.Length - 1
    9.     Dim sText() As String = Split(Lines(line_idx), ",")
    10.     If sText.Length >= 2 Then  ' A little bit of checking never hurts
    11.         AddedLines.Add(Environment.NewLine + sText(1))
    12.     End If
    13.     Progress = CInt(line_idx / Lines.Length * 100) ' in %%
    14.     ' Add progressbar updating here
    15.     ' Something like ProgressBar1.Value = Progress
    16.     ' Do not forget to allow the application to update the usercontrols
    17.     ' Though it slows down the execution a little - it's a price for progressbar:
    18.     Application.DoEvents
    19. Next
    20. Tbox.Lines = AddedLines.ToArray

    Should work, but I wrote that w/o IDE so there might be some errors.

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