I need a string that I can use for page header. The problem is when i use vbcrlf then i don’t know how to come back up and write.
Example:
dim MyStr As String = "Amount to be" & vbcrlf & "Deducted in This Month" & VbCrLf
MyStr &= "Amount Paid Last" & VbCrLf & "Month" & VbCrLf
This Gives me Output
Amount to be
Deducted in This Month
Amount Paid Last
Month
‘—I Want the Output like this
Amount to be Amount Paid Last
Deducted in This Month Month
‘Please help me to findout the solution.
You should always use composite formatting in a case like this. Be sure to read up on it in the MSDN Library. A key feature to take advantage of here is its ability to align the text and pad it with spaces. The format specifier should look like
{n,w:c}where n is the argument number, w is the width of the generated string and c is the desired format. Use a negative value for w to align the text to the left.So code like this:
Produces this output:
It will only look properly aligned if you look at the file with a file viewer that uses a fixed-pitch font.