search a text box by character length in Visual Basic

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Coreyhis
    New Member
    • Feb 2013
    • 1

    search a text box by character length in Visual Basic

    I have richtextbox1.te xt (that shows a list of items). I would like to
    search that box for the same number of characters and show the results
    in another text box (text box 2)




    Code:
    For Each item As String In RichTextBox2.Lines
    
            If item.Length = "\w{80}" then
     
                   ' do not now what to do ????
    
            End if
    
        Next



    Here is a image of what i am asking:

  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Please attach the image to the thread itself. Most image sharing sites are blocked by our firewall.

    Also, this is not a code writing service but if you post the code you've tried along with a description of the problem with the code, we can help guide you to a solution.

    Comment

    • Mikkeee
      New Member
      • Feb 2013
      • 94

      #3
      Coreyhis, something is strange here. You have an image of a VB6 form but your code is VB.NET. What dev environment are you actually using?

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        It sounds as though the missing piece of the code is simply to append the text from item to Textbox1.

        In VB6 this could be as simple as
        Code:
        Textbox2 = Textbox2 & item.<[B]whatever[/B]> & VbNewLine
        In VB.Net I have no idea how to concatenate a string. Also, the "<whatever>" is there because I'm not familiar with the object model so don't know what property contains the text.

        Comment

        Working...