Results 1 to 6 of 6

Thread: Really Basic Q

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2001
    Posts
    4
    Right, I just got vb on the weekend and i've been playing around with it.

    I want to make a really basic chat program.

    I'm using 2 text boxes on the form (text1 & text2)

    The text I type into text2 gets copied into text1 with a username added to it.

    Anyhow, the problem is, when I send the second sentence I end up with;

    <catcalls>hello!<catcalls>why!?!?<catcalls> F**K THIS!!!

    instead of;
    <catcalls> Hi!
    <catcalls> Finally,
    <catcalls> It works...

    Y'see, what i'm missing is NEW LINE

    So, how do I make text1 go to a new line each time?

    I want something I can tag on the end of

    text1.text = text2.text + /n 'as the new line

    I tried /n but it didnt work. What's the code for new line?

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    vbCrLf
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2001
    Posts
    4

    Talking

    Ha ha ha ha.........

    Well, after reading the Visual Basic FAQ I discovered

    Text1.Text = Text1.Text + Text2.Text & Chr$(13) & Chr$(10)

    But it seems Cander beat me to it with vbcrfl

    Sweet,

    big thanks
    Last edited by catcalls; Feb 7th, 2001 at 02:22 PM.

  4. #4
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    vbCr = Chr$(13)
    vbLf = Chr$(10)
    vbCrlf = Chr$(13) & Chr$(10)
    Oh ya, there is a new line constant, vbNewLine

  5. #5
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    vbCrLf is the same thing.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  6. #6
    Guest
    vbNewLine is only avialable in VB5+, while vbCrLf is supported in earlier versions.

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