|
-
Mar 26th, 2000, 08:37 AM
#1
Thread Starter
Member
What is the syntax to align something in the center
richtextbox1.SelAlignment = ?
thanks
-
Mar 26th, 2000, 08:49 AM
#2
Hyperactive Member
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 )
Code:
If richtextbox1.SelLength > 0 Then
richtextbox1.SelAlignment = 0
End If
0 - Left
1 - Right
2 - Center
-
Mar 26th, 2000, 08:50 AM
#3
Fanatic Member
A Couple of choices
Hi steel,
You can use
Code:
richtextbox1.SelAlignment = 2
or
richtextbox1.SelAlignment = rtfCenter
Sorry Gen-X, but I have to disagree with you based on this information from MSDN:
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.
All the best.
[Edited by OneSource on 03-26-2000 at 08:53 PM]
-
Mar 26th, 2000, 09:02 AM
#4
Hyperactive Member
Hey I just copied the example from MSDN...
They put in the test for SelLength not me :smile:
-
Mar 26th, 2000, 09:15 AM
#5
Fanatic Member
-
Mar 26th, 2000, 11:49 AM
#6
Thread Starter
Member
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
|