vbCrlf works in text box 1 but not text box 2


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 8 of 8

Thread: vbCrlf works in text box 1 but not text box 2

  1. #1
    Join Date
    Sep 2004
    Posts
    45

    vbCrlf works in text box 1 but not text box 2

    A User selects items from a list. Each selection is displayed in text box 1 in multiple lines. The operating cost for the item is displayed in text box 2. Both text boxes are long enough to accommodate multiple entries. Eventually a running sub total will be displayed in text box 3 located below text box 2. VbCrlf works fine in text box 1 but won't work in text box 2. Multiple selections display one below the other in text box 1 but the cost of the last selection replaces the previous selection in text box 2. No matter how many selections are displayed in text box 1 only 1 value is displayed in text box 2. I've searched here and many sources but haven't found an answer to this. Any advice greatly appreciated.
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Try deleting textbox2 from the form and replacing it by cutting and pasting textbox1, to ensure that the properties of the two boxes are the same.
    Phil Weber
    http://www.philweber.com

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

  3. #3
    Join Date
    Sep 2004
    Posts
    45

    vbCrlf

    Thanks. I checked it out and discovered I made a mistake. Haven't worked on this in a long time. Selections are transferred from one list box to another list box, not text box 1. Only the costs are displayed in a text box. Still can't figure out why vbcrlf works in a list box but not the text box.

  4. #4
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    vbCrLF does work in a multiline, standard, VB text box.

    If it isn't working in your textbox then one of those criteria is not being met.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  5. #5
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Have you set the textbox's MultiLine property to True?
    Phil Weber
    http://www.philweber.com

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

  6. #6
    Join Date
    Sep 2004
    Posts
    45

    vbCrlf

    Yes. The text box multi-line property is set to True.

  7. #7
    Join Date
    Sep 2004
    Posts
    45
    The more I fix the more I run into a hornet's nest. If "remove item" is enabled for list box 1 and 2, items move from 1 to 2 when selected but the cost doesn't change in text box 1. When the first item is selected, the cost for that item is displayed and stays there. I'm about ready to chuck this nightmare. Have been working on it on and off for a very long time. Seemed like a simple enough concept but I simply don't know how to get it to work. All I want to do is select items from a list box, have the cost for each item display in a text box with a running total in another text box. Every time I search for VB help all I find is answers to much more sophisticated problems. Thanks for your help.

  8. #8
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Quote Originally Posted by wisgro
    All I want to do is select items from a list box, have the cost for each item display in a text box with a running total in another text box.
    This seems like a fairly easy to accomplish program specification.

    If you handed this to me, my question would be: When I select something from the listbox, where is the associated price coming from? Am I reading it from a database? A text file? Do I just make something up?

    Other than that I would have two number variables. Something like intPrice and intTotal. intPrice would hold the individual price which would be added to intTotal.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

Similar Threads

  1. Replies: 4
    Last Post: 11-28-2005, 03:14 PM
  2. Text box validate on Access Please help
    By benz84 in forum VB Classic
    Replies: 2
    Last Post: 11-14-2005, 05:38 AM
  3. Building a Rich Text Box Component using ASP.NET
    By Nitin Mistry in forum ASP.NET
    Replies: 3
    Last Post: 07-04-2003, 02:56 PM
  4. sequence of text box validation
    By Liglin in forum Web
    Replies: 1
    Last Post: 01-10-2003, 03:54 PM
  5. Hiding the text in Rich Text Box
    By Javaid Ahmad in forum VB Classic
    Replies: 0
    Last Post: 04-13-2000, 12:46 PM

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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

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