Results 1 to 10 of 10

Thread: TextBox Color and Font

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2000
    Posts
    45
    Hi All
    I have a text in the TextBox, the text color is black and font size is 8.
    How can I change the color and the font size only for one word or one letter in the text?

    Thanks
    VBmaster

  2. #2
    Lively Member
    Join Date
    Mar 2000
    Posts
    82
    Use a RichTextBox.
    VB 6.0 Pro | VC++ 6.0

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2000
    Posts
    45

    Question

    O.K Know I have in my toolbar the RichTextBox Pro 6.0, but how am I working with it.
    Can you give me exact answer or example?
    How can I do it?
    (Change the text Color and Text FontSize of one Word or Letter in the text)

    Thanks


    VBmaster

  4. #4
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    this is kind of one of the areas that i am alright @

    Code:
    Private Sub Command1_Click()
    rtb1.SelColor = vbRed
    'Sets selected text to red
    End Sub
    Private Sub Command2_Click()
    rtb1.SelFontSize = 15
    'sets selected text to size 15
    End Sub
    good luck

  5. #5

    Thread Starter
    Member
    Join Date
    Apr 2000
    Posts
    45

    Smile

    Thanks David
    VBmaster

  6. #6

    Thread Starter
    Member
    Join Date
    Apr 2000
    Posts
    45

    Question

    Hi All
    Is there a possibility to make the RichTextBox -> Alignment=2(center)

    Thanks
    VBmaster

  7. #7
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    yeah, i knew, but u did not ask for that info,

  8. #8

    Thread Starter
    Member
    Join Date
    Apr 2000
    Posts
    45

    Question Thank David,try to halp me agin.

    I use the same version VB 6 SP3
    And I don’t have Alignment or RightToLaft option in the RichTextBox
    See if you know something abut this

    Thanks
    VBmaster

  9. #9
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    sorry, i thought you were telling me, not asking me, well i'll get that code for you ok?

  10. #10
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    sure, here you go
    i got this to work
    Code:
    RichTextBox1.SelAlignment = vbCenter
    it sets the selected text to the middle,
    i think the other properties are
    Code:
    vbLeft
    vbRight
    'and
    vbJustify '<-- ???
    but i am not sure

    oh well good luck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width