What is the syntax to align something in the center
richtextbox1.SelAlignment = ?
thanks
Printable View
What is the syntax to align something in the center
richtextbox1.SelAlignment = ?
thanks
SelAlignment only works if you already have text selected. If you dont have anything selected then it cannot "Sel(ect)Alignment"
You need to use the SelStart and SelLength to set what is currently selected (or alternatively use the mouse to select the portion and then in your procedure you can do the following )
0 - LeftCode:If richtextbox1.SelLength > 0 Then
richtextbox1.SelAlignment = 0
End If
1 - Right
2 - Center
Hi steel,
You can useSorry Gen-X, but I have to disagree with you based on this information from MSDN:Code:richtextbox1.SelAlignment = 2
or
richtextbox1.SelAlignment = rtfCenter
All the best.Quote:
The SelAlignment property determines paragraph alignment for all paragraphs that have text in the current selection or for the paragraph containing the insertion point if no text is selected.
[Edited by OneSource on 03-26-2000 at 08:53 PM]
Hey I just copied the example from MSDN...
They put in the test for SelLength not me :smile:
:)
Thanks guys