Results 1 to 5 of 5

Thread: Mark text

  1. #1
    Guest
    Hi!
    I am trying to make like a NotePad program. I'm now working with how to change fonts and weight, but the weight part isn't succesful. How can i make the text I have marked bold?

    / Erik

  2. #2
    Guest
    Don't use a regular textbox. Use a RichTextBox.

    And here is the code to make the selected text bold:

    Code:
    Private Sub Command1_Click()
    If RichTextBox1.SelText <> "" Then
    If RichTextBox1.SelBold = False Then
    RichTextBox1.SelBold = True
    Else
    RichTextBox1.SelBold = False
    End If
    End If
    End Sub

  3. #3
    Guest
    Hi again!
    Thanks for the help, but how do I create a RichTextBox?

    / Erik

  4. #4
    Guest
    Click on Project > Components... and make sure Microsoft Rich TextBox Control 6.0 (or whatever version you have) is checked.

  5. #5
    Guest
    Matthew: You can accomplish what you did much easier using the Not logic operator.
    Code:
    RichTextBox1.SelBold = Not RichTextBox1.SelBold

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