Results 1 to 6 of 6

Thread: [RESOLVED] NextLine in Text1.Text ?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Location
    Belgium
    Posts
    104

    Resolved [RESOLVED] NextLine in Text1.Text ?

    Hello,

    I know this is really a newbie question , but I have tried several methods to have one line under the other line?

    What I need is simple , when a string come in it will be put on the first line.
    When the next string come in , it will be put on the next line , and so on.

    But in the below script , the next line overwrite the first one

    VB Code:
    1. Private Sub Timer1_Timer()
    2. Timer1.Enabled = False
    3. Dim TextString
    4.     For i = 0 To (strInput(0) And &H1F)
    5.     TextString = TextString + Hex$(strInput(i)) + "H "
    6. '    Text1.Text = Text1.Text + Hex$(strInput(i)) + "H " & Chr$(13) + Chr$(10)
    7.     Next i
    8.     Text1.Text = TextString & Chr$(13) + Chr$(10)
    9. End Sub

    Thanks Again for your good help
    Best Regards,
    Didier.

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: NextLine in Text1.Text ?

    VB Code:
    1. Text1.Text=TextString & vbcrlf & Text1.Text
    Please mark you thread resolved using the Thread Tools as shown

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: NextLine in Text1.Text ?

    The problem is that you are just giving it the new text, you need to put the previous text in too:
    VB Code:
    1. Text1.Text = [u]Text1.Text &[/u] TextString & vbNewLine

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Location
    Belgium
    Posts
    104

    Re: NextLine in Text1.Text ?

    YES

    Thank you BOTH for the FAST and GOOD reply , it works

    Best Regards,
    Didier
    Last edited by DRI66; Feb 7th, 2007 at 01:00 PM.

  5. #5
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: NextLine in Text1.Text ?

    VB Code:
    1. Private Sub Timer1_Timer()
    2. Timer1.Enabled = False
    3. Dim TextString
    4.     For i = 0 To (strInput(0) And &H1F)
    5.     TextString = TextString + Hex$(strInput(i)) + "H "
    6.     Next i
    7.   [B]  Text1.Text =Text1.Text & vbCrLf&  TextString [/B]
    8. End Sub
    Please mark you thread resolved using the Thread Tools as shown

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Location
    Belgium
    Posts
    104

    Re: NextLine in Text1.Text ?

    THANK YOU ALL
    Quote Originally Posted by danasegarane
    VB Code:
    1. Private Sub Timer1_Timer()
    2. Timer1.Enabled = False
    3. Dim TextString
    4.     For i = 0 To (strInput(0) And &H1F)
    5.     TextString = TextString + Hex$(strInput(i)) + "H "
    6.     Next i
    7.   [B]  Text1.Text =Text1.Text & vbCrLf&  TextString [/B]
    8. End Sub

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