Results 1 to 3 of 3

Thread: Textbox

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 1999
    Posts
    4
    How would you make some words in a textbox bold and some not with VB5?

  2. #2
    Lively Member
    Join Date
    Jan 1999
    Location
    India
    Posts
    85
    you may have to use richText box control

    Ramdas

  3. #3
    Guest
    Try working with this code:

    Code:
    Private Sub Form_Load ()
     With RichTextBox1
         .Text = "Welcome to the RichTextBox Sample Source Code!"
         .SelStart = 0
         .SelLength = Len(.Text)
         .SelFontName = "Arial"
         .SelFontSize = 10
         .SelAlignment = rtfCenter
         .SelStart = InStr(.Text, "RichTextBox") - 1
         .SelLength = Len("RichTextBox")
         .SelFontName = "Courier New"
         .SelColor = vbBlue
         .SelStart = InStr(.Text, "Sample Source Code") - 1
         .SelLength = 4
         .SelFontName = "Courier New"
         .SelUnderline = True
         .SelStart = .SelStart + 1
         .SelLength = 1
         .SelColor = vbRed
         .SelStart = .SelStart + 1
         .SelLength = 1
         .SelColor = vbBlue
         .SelStart = .SelStart + 1
         .SelLength = 1
         .SelColor = vbGreen
         .SelStart = 0
         .SelLength = 0
      End With
    End Sub
    Hope that helps.

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