VB School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB Expert!

Join 307,029 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,211 people online right now. Registration is fast and FREE... Join Now!




Output Text Formatting

 

Output Text Formatting, VB6

JohnnyRocket

1 Nov, 2009 - 11:25 AM
Post #1

New D.I.C Head
*

Joined: 1 Nov, 2009
Posts: 2


My Contributions
I'm new to programming and have hit a stump on my current class assignment. I am trying to output several different strings into a lblbox where each different string appears on a different line, like if you were to hit return. What code do I have to enter to make that work? Below is a copy of my current code. Thanks.


totalPackageA = decAmountA * 99 - decDiscountA
lblAnswers.Text = "Package A: " & totalPackageA.ToString("c")
totalPackageB = decAmountB * 199 - decDiscountB
lblAnswers.Text += "Package B: " & totalPackageB.ToString("c")
totalPackageC = decAmountC * 299 - decDiscountC
lblAnswers.Text += "Package C: " & totalPackageC.ToString("c")
totalAmount = totalPackageA + totalPackageB + totalPackageC
lblAnswers.Text += "Grand Total: " & totalAmount.ToString("c")
End Sub

User is offlineProfile CardPM
+Quote Post


June7

RE: Output Text Formatting

2 Nov, 2009 - 04:59 PM
Post #2

D.I.C Regular
Group Icon

Joined: 9 Dec, 2008
Posts: 485



Thanked: 38 times
My Contributions
Concatenate the carriage return/line feed code into the string:
CODE
totalPackageA = decAmountA * 99 - decDiscountA
lblAnswers.Text = "Package A: " & totalPackageA.ToString("c") & vbCRLF
totalPackageB = decAmountB * 199 - decDiscountB
lblAnswers.Text += "Package B: " & totalPackageB.ToString("c") & vbCRLF
totalPackageC = decAmountC * 299 - decDiscountC
lblAnswers.Text += "Package C: " & totalPackageC.ToString("c") & vbCRLF
totalAmount = totalPackageA + totalPackageB + totalPackageC
lblAnswers.Text += "Grand Total: " & totalAmount.ToString("c")

User is offlineProfile CardPM
+Quote Post

JohnnyRocket

RE: Output Text Formatting

2 Nov, 2009 - 07:38 PM
Post #3

New D.I.C Head
*

Joined: 1 Nov, 2009
Posts: 2


My Contributions
QUOTE(June7 @ 2 Nov, 2009 - 04:59 PM) *

Concatenate the carriage return/line feed code into the string:
CODE
totalPackageA = decAmountA * 99 - decDiscountA
lblAnswers.Text = "Package A: " & totalPackageA.ToString("c") & vbCRLF
totalPackageB = decAmountB * 199 - decDiscountB
lblAnswers.Text += "Package B: " & totalPackageB.ToString("c") & vbCRLF
totalPackageC = decAmountC * 299 - decDiscountC
lblAnswers.Text += "Package C: " & totalPackageC.ToString("c") & vbCRLF
totalAmount = totalPackageA + totalPackageB + totalPackageC
lblAnswers.Text += "Grand Total: " & totalAmount.ToString("c")




Thank you! biggrin.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 08:26AM

Live VB Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month