trying to set large bolt font in a richtextbox vb6

With rtfDay(19)
    .Text = "3"
    .SelFontName = "Arial"
    .SelFontSize = 28
    .SelAlignment = rtfCenter
    .SelBold = True
End With

Open in new window

The 3 gets entered into the Ricjhtextbox, but is not large or bold
what is the problem ?
isnoend2001Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongCommented:
try set SelStart and SelLength properties first?

With rtfDay(19)
    .Text = "3"
   .SelStart = 1
    .SelLength = 1

    .SelFontName = "Arial"
    .SelFontSize = 28
    .SelAlignment = rtfCenter
    .SelBold = True
End With
0
isnoend2001Author Commented:
Thanks did not fix the issue
0
Ryan ChongCommented:
check this out and see if it helps? (I don't have VB6 with me so can't really run and test it)

change the color of rich text box in vb6
http://www.codeproject.com/Questions/776677/change-the-color-of-rich-text-box-in-vb
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Chris WatsonSoftware DeveloperCommented:
Ryan, you were so close.

isno, change the SelStart assignment to:

.SelStart = 0

Open in new window


Big ol' 3.
That seems to work.
0
Ryan ChongCommented:
ok, I must have forgotten SelStart index should start from 0...  not doing VB6 for many years now
0
isnoend2001Author Commented:
Don't know why it does not work for mertf filertf file
0
isnoend2001Author Commented:
Don't know why it does not work for me. the code:
Private Sub Command1_Click()
With rtfDay(19)
    .SelStart = 0
    .SelLength = 1
    .Text = "3"
    .SelFontName = "Arial"
    .SelFontSize = 28
    .SelAlignment = rtfCenter
    .SelBold = True
    .BackColor = vbWhite
End With
End Sub

Open in new window

0
Chris WatsonSoftware DeveloperCommented:
Try setting the Text property before the SelStart and SelLength properties, like the order in Ryan's post.

Private Sub Command1_Click()
    With rtfDay(19)
        .Text = "3"
        .SelStart = 0
        .SelLength = 1
        .SelFontName = "Arial"
        .SelFontSize = 28
        .SelAlignment = rtfCenter
        .SelBold = True
        .BackColor = vbWhite
    End With
End Sub                             

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
isnoend2001Author Commented:
Thanks that worlks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.