[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


rtf alignment problem

Posted on 2005-05-13
Medium Priority
Last Modified: 2010-05-18
hi Experts
I am trying to add text to an existing rtf file using richtextbox in vb6 The rtf i am trying to add text to has a large font
label center aligned. I want the text following this label to be left aligned. Seems i only have a problem when the enter key is
not pressed after entering the large label.
Here is what i have tried:
myrtf.selstart = len(myrtf.text) +1

myrtf.seltext = vbcrlf & "some text" <-This would inherit the center alignment

myrtf. SelAlignment = rtfLeft <-this moves the large label and added text to the left. This also makes the new text the same size and color of the large centered label

How can i add left aligned text under this centered large font label ? and not inherit it's  font and color?
Question by:isnoend2001
LVL 19

Accepted Solution

Shauli earned 1000 total points
ID: 14001558
myrtf.SelFontName = "Arial Narrow"
myrtf.SelFontSize = 36
myrtf.SelBold = True
myrtf.SelText = "Big Label"
myrtf.SelAlignment = rtfCenter
myrtf.SelStart = Len(myrtf.TextRTF) + 1
myrtf.SelFontName = "Times New Roman"
myrtf.SelFontSize = 12
myrtf.SelBold = False
myrtf.SelText = vbCrLf & "My new text below the big label is the new text below the new label, that is my new text below the big label."
myrtf.SelAlignment = 0


Author Comment

ID: 14002803
Thanks Shauli
That works

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question