Carriage return, line feed won't come back

DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Carriage return, line feed won't come back

  1. #1
    Join Date
    Sep 2004

    Carriage return, line feed won't come back

    When a user selects an item in list box 1 and transfers it to list box 2 a corresponding cost should be displayed in a text box. The carriage return/line feed won't work. Consequently each cost is replaced by the next vlaue.
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2003
    Portland, OR
    I assume that you're assigning the desired value to the textbox's .Text property:

    txtBox.Text = "new value"

    This replaces the existing text in the textbox with the new value. To add text to the textbox rather than replace it, you may use string concatenation:

    txtBox.Text = txtBox.Text & vbCrLf & "new value"

    You may also use the .SelStart and .SelText properties to insert text at a desired location. The following code, for example, adds "new value" to the end of the existing text:
    With txtBox
        ' Set insertion point to end of text
        .SelStart = Len(.Text)
        ' Insert new text
        .SelText = vbCrLf & "new value"
    End With
    P.S. -- For future reference, it's better to include the specific lines of code with which you're having difficulty in the body of your message, rather than including your project as an attachment. Few people are willing to download and debug your entire project, but many will troubleshoot a few lines of code.
    Phil Weber

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Replies: 4
    Last Post: 04-01-2005, 05:00 PM
  2. Return Codes back from Sybase to VB App...
    By Scott Blackburn in forum VB Classic
    Replies: 1
    Last Post: 02-12-2001, 02:11 AM
  3. Sample Sites.
    By Murray Foxcroft in forum Web
    Replies: 5
    Last Post: 11-02-2000, 02:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center