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.
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:
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.
' Set insertion point to end of text
.SelStart = Len(.Text)
' Insert new text
.SelText = vbCrLf & "new value"
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
Last Post: 04-01-2005, 06:00 PM
By Scott Blackburn in forum VB Classic
Last Post: 02-12-2001, 03:11 AM
By Murray Foxcroft in forum Web
Last Post: 11-02-2000, 03:42 AM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center