|
-
Dec 3rd, 2002, 03:48 AM
#1
Thread Starter
Hyperactive Member
Rich TextBox Alignment.
Hi,
I have a form with a rich textbox control.
I am trying to align text in the rich textbox with:
VB Code:
Dim a As String * 50
Dim b As String * 10
Dim c As String * 5
a = "AAAA"
b = "BBB"
c = "%%%"
rtb.Text = a & vbTab & b & vbTab & c
a = "WWWW"
b = "XXX"
c = "F"
rtb.Text = rtb.Text & vbCr & a & vbTab & b & vbTab & c
a = "QQQQQQQQQQQQQQQQQQQQQQQQQ"
b = "TTTTTTTTTT"
c = "10101"
rtb.Text = rtb.Text & vbCr & a & vbTab & b & vbTab & c
The text is not displayed in column-like fashion.
I've tried to remove the * 50, *10, *5 from the Dim; changing fonts; but I just cannot seem to figure a way out.
Any ideas?
Thanx
-
Dec 3rd, 2002, 06:02 AM
#2
Tabs come after certain periods. If text goes over, it jumps to the next. So only way would be to either set tabs into different places or then using a fixed length font (such as FixedSys or Courier New) and doing following:
VB Code:
Dim a As String * 50
Dim b As String * 10
Dim c As String * 5
rtb.Font.Name = "FixedSys"
rtb.Font.Size = 9
a = "AAAA"
b = "BBB"
c = "%%%"
rtb.Text = a & b & c
a = "WWWW"
b = "XXX"
c = "F"
rtb.Text = rtb.Text & vbCrLf & a & b & c
a = "QQQQQQQQQQQQQQQQQQQQQQQQQ"
b = "TTTTTTTTTT"
c = "10101"
rtb.Text = rtb.Text & vbCrLf & a & b & c
Hope this is of any help.
-
Dec 3rd, 2002, 06:20 AM
#3
Thread Starter
Hyperactive Member
Thank you!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|