Re: Setting tab stops in RTF control

Tech-Archive recommends: Speed Up your PC by fixing your registry




"mabond" <mabond@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4F8D5445-22E6-4B55-963F-2515F9066E85@xxxxxxxxxxxxxxxx
Hi all

I have an rtf control on my form. The control is populated with text from
an
string array created as the application runs. The code to populate the rtf
control is as follows

For l = 0 To arrayList.GetUpperBound(0)
If arrayList(l, 0) Is Nothing Then
'do nothing
Else
output &= arrayList(l, 0) & vbTab & vbTab _
& arrayList(l, 1) & vbTab _
& arrayList(l, 2) & vbTab _
& arrayList(l, 3) & vbCrLf
End If
Next

RichTextBoxList.Text = output


My problem is that the 4 columns do not line up neatly in this method as
the
strings in any element of the array may be longer (or shorter) than that
in
the next element of the array. In some case the first index of the array
element will be longer than where the first tab would normally go in the
control and the next will be shorter. So the two columns are not lined up.
I
need to be able to adjust, programatically, the gap between the tab stops
in
the rtf control.

Is that possible or is there another solution

Thanks and regards

Michael Bond


I've dealt with that problem in the past by using a fixed-fount, such as
"Courier".

When I was dealing with it, the problem was that some fonts are designed
with
different widths for each character to make them more pleasing to the eye.

Ross


.



Relevant Pages

  • Re: Conversion Problem
    ... > ...talking about control arrays: ... > Why does a CommandButton have an Index even if it does ... just because it may or may not be part of an array. ... Because it's a hack. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Conversion Problem
    ... ...talking about control arrays: ... Why does a CommandButton have an Index even if it does not ... because it may or may not be part of an array. ... Now being able to attach any handler of any event as long as ...
    (microsoft.public.dotnet.languages.vb)
  • Re: global warming: is it us, or is it the sun?
    ... > structure (there is no such thing as a rigid structure on that scale) get ... if you use the whole array area as transmitting ... bit of control subsystems, etc. ... The power beam would be steered via coordinating the ...
    (sci.space.policy)
  • Re: IsCollection?
    ... whether or not a Control is a collection (or belongs to an array of ocntrols)? ... Text1.Count will give me the total elements of this control ... Now add a third command button to the form but DON'T make it part of the control array. ... If TypeOf Command1 Is Object Then ...
    (microsoft.public.vb.general.discussion)
  • Re: create rtf document with VBA
    ... Currently I've solved it by saving the document to disk, ... To do it without saving to disk, you need to use an RTF control. ... FMS has a rich textbox control. ...
    (comp.databases.ms-access)