zunebuggy65
Active member
- Joined
- Oct 12, 2023
- Messages
- 42
- Programming Experience
- 3-5
I do not wish to use a DataGrid for what I am doing. I am instead using a RichTextBox and Courier New font. I have some text on each line that the first 10-24 characters could have varying lengths, but then on each line I have 3 integers that are zero left padded. I want to make sure that in every line these 3 integers line up. If I start the integers displaying at 29 or 30 characters from the left hand side of the RichTextBox, this is fine because the text before that will never be more than 24 characters long.
For example:
I have tried taking each line of text before the integers and getting the length and then using
and then using a For Next Loop appending n number of space before appending the integers, but the string that makes up the text before the integers is complicated and even with the fixed width font, the integers do not line up neatly.
I was just wondering if there was some string command that can be used with the RichTextBox that would automatically create nice columns of integers after the text?
I worked for years using various forms of BASIC and one of them (I do not remember which one) had a SPC or POS command but I do not see anything like that in VB.Net searching online.
Thank you.
For example:
VB.NET:
10: This is some text 095 124 003
11: This another line 240 395 503
12: And yet another 105 012 000
I have tried taking each line of text before the integers and getting the length and then using
VB.NET:
n = 29 - Len(string)
I was just wondering if there was some string command that can be used with the RichTextBox that would automatically create nice columns of integers after the text?
I worked for years using various forms of BASIC and one of them (I do not remember which one) had a SPC or POS command but I do not see anything like that in VB.Net searching online.
Thank you.