DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Posts
    96

    Rich textbox question

    does anyone know how to set text inside a rich textbox to bold? I get that the bold property is read only.

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    To use the example from your other post:
    Code:
    rtfText.Text = "I want to save "
    With rtfText
        ' Begin selection
        .Select(.Text.Length, 0)
        ' Set selected text to bold
        .SelectionFont = New Font(.Font, FontStyle.Bold)
        ' Append bold text
        .AppendText("THIS")
    End With
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Jan 2004
    Posts
    96
    thanks, that works.

  4. #4
    Join Date
    Nov 2003
    Posts
    8
    Hi,

    Private Sub Button1_Click...

    If Not rtfText.SelectionFont.Bold = True Then
    rtfText.SelectionFont = New Font(Font, FontStyle.Bold)
    Else
    rtfText.SelectionFont = New Font(Font, FontStyle.Regular)
    End If

    End Sub

    Watch and copy examples of Source Code in VB.NET
    http://www.geocities.com/yulyos4vbnet

    Have a nice day
    Last edited by yulyos; 03-29-2004 at 03:46 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links