You have 9 characters in "Sub Total".
Dim ColSize As Integer = 9
ReceiptTB.AppendText(vbNewLine + vbTab + vbTab + vbTab & "Tax1 on order: " + vbTab & Strings.Right(Space(ColSize) & Tax1TB.Text, ColSize))
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi everyone,
I try to find the way of aligning the currencies to the right as shown in the image below, here is the image followed by the code:
Private Sub BtnAddToBasket_Click(sender As Object, e As EventArgs) Handles BtnAddToBasket.Click
OthersTC.SelectedTab = ReceiptTP
OrderTimeTB.Text = TimeOfDay
ReceiptTB.AppendText(vbTab + vbTab + vbTab & "AUTO-CAISSE ORDERING SYSTEMS")
ReceiptTB.AppendText(vbTab + vbTab + vbTab & "=========================================================================== " & vbNewLine)
ReceiptTB.AppendText(" " + vbNewLine)
ReceiptTB.AppendText("Name:" + vbTab + CustomerNameTB.Text + vbTab + "Phone No:" & CustomerPhoneTB.Text + vbTab +
"Ref.No:" & ReferenceTB.Text + vbNewLine)
ReceiptTB.AppendText(vbNewLine + "Order date:" + vbTab & OrderDateTB.Text + vbTab + "Order time:" + vbTab & OrderTimeTB.Text + vbNewLine)
ReceiptTB.AppendText(vbNewLine + "Item type " + vbTab + vbTab & "Qty " + vbTab & "Unit Price:" + vbTab & "Sub Total " + vbNewLine)
ReceiptTB.AppendText(vbNewLine + "Nose ring: " + vbTab & Qty1TB.Text + vbTab & UnitPrice1TB.Text + vbTab + vbTab & SubTotal1TB.Text)
ReceiptTB.AppendText(vbNewLine + "Earings: " + vbTab + vbTab & Qty2TB.Text + vbTab & UnitPrice2TB.Text + vbTab + vbTab & SubTotal2TB.Text)
ReceiptTB.AppendText(vbNewLine + "Piercing jewelries: " + vbTab & Qty3TB.Text + vbTab & UnitPrice3TB.Text + vbTab + vbTab & SubTotal3TB.Text + vbNewLine)
ReceiptTB.AppendText(vbNewLine + vbTab + vbTab + vbTab & "Order sub total: " + vbTab & OrderSubTotalTB.Text + vbNewLine)
ReceiptTB.AppendText(vbNewLine + vbTab + vbTab + vbTab & "Tax1 on order: " + vbTab & Tax1TB.Text)
ReceiptTB.AppendText(vbNewLine + vbTab + vbTab + vbTab & "Tax2 on order: " + vbTab & Tax2TB.Text)
ReceiptTB.AppendText(vbNewLine + vbTab + vbTab + vbTab & "Tax3 on order: " + vbTab & Tax3TB.Text + vbNewLine)
ReceiptTB.AppendText(vbNewLine + vbTab + vbTab + vbTab & "Order total: " + vbTab & TotalTB.Text + vbNewLine)
ReceiptTB.AppendText(vbTab + vbTab + vbTab & "=========================================================================== " & vbNewLine)
ReceiptTB.AppendText(vbTab + vbTab + vbTab & "THANK YOU FOR SHOPPING WITH US" + vbNewLine)
End Sub
You have 9 characters in "Sub Total".
Dim ColSize As Integer = 9
ReceiptTB.AppendText(vbNewLine + vbTab + vbTab + vbTab & "Tax1 on order: " + vbTab & Strings.Right(Space(ColSize) & Tax1TB.Text, ColSize))
It is only a quick idea...
string.padleft(MaximumLength)
Thank you djanchezl,
I would like to try your suggestion, can you show me where in my code I will put this?
I am getting better in .net because of good programmer that helps like yourself.