Text Alignment

  • Thread starter Thread starter beelzebub
  • Start date Start date
B

beelzebub

Guest
Please Help.
I have a form in which you select a header from a ListBox and add a string along with it from TextBox1, then add them both to TextBox2.

Private Sub CmdBtn_Click()
Dim ListHeader as String
ListHeader = ListBox.Column(0, ListBox.ListIndex)
TextBox2 = TextBox2 & ListHeader & TextBox1 & vbCrLf
End Sub

My problem is that I have the choice of about 50 headers (ranging from 4 characters long to 25 characters long) I would like the text from TextBox1 to be aligned. i.e:

Height: 8.5
Width: 6.3
External Colour: Red

I want to be able to do this without using a non-proportional font (Courier).

Can anyone help?
Thanks in advance.

Beelze
 
Is there a compelling reason for you to concatenate these two fields into one textbox? If not, you could simply keep the two textboxes separate, and everything in Textbox1 will remain aligned.

Also, I would guess that with the code you've included, Textbox2 will double in size every time CmdBtn is clicked.
 
That's right it does double in size. The main objective of this section of my form is to select specification headers from a list, then to add an amount (as in my example). The form is then mailmerged to a Word Template. I need the data from ListBox and TextBox1 together so that it can be merged as one field.
 

Users who are viewing this thread

Back
Top Bottom