Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8651453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:04:37+00:00 2026-06-12T14:04:37+00:00

I have this code: print_text.Text = Patient number: + ds.Tables(patients).Rows(0).Item(0) print_text.AppendText(Environment.NewLine) print_text.Text = print_text.Text

  • 0

I have this code:

print_text.Text = "Patient number: " + ds.Tables("patients").Rows(0).Item(0)
print_text.AppendText(Environment.NewLine)
print_text.Text = print_text.Text + "Last name: " + ds.Tables("patients").Rows(0).Item(1)
print_text.AppendText(Environment.NewLine)

Now the above data i am adding programatically and it works fine. However in the above code i want to add Patient number and Last name in bold font.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:04:38+00:00Added an answer on June 12, 2026 at 2:04 pm

    When using a RichTextBox, why not just use RTF?


    Example:

    Sub Main
        Dim f = new Form()
        Dim print_text = new RichTextBox() With {.Dock = DockStyle.Fill}
        f.Controls.Add(print_text)
    
        Dim sb = new System.Text.StringBuilder()
        sb.Append("{\rtf1\ansi")
        sb.Append("This number is bold: \b 123\b0 ! Yes, it is...")
        sb.Append("}")
        print_text.Rtf = sb.ToString()
    
        f.ShowDialog()
    End Sub
    

    Result:

    RichTextBox with bold text

    MSDN


    This way, you can also easily wrap the RTF stuff into extension methods:

    Module RtfExtensions
    
        <Extension()>
        Public Function ToRtf(s As String) As String
            Return "{\rtf1\ansi" + s + "}"
        End Function
    
        <Extension()>
        Public Function ToBold(s As String) As String
            Return String.Format("\b {0}\b0 ", s)
        End Function
    
    End Module
    

    and use it like

    Dim text = "This number is bold: " + "123".ToBold() + "! Yes, it is..."
    print_text.Rtf = text.ToRtf()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have run this Perl code: #!/usr/bin/perl print content-type: text/html \n\n; print Hello World.\n;
I have this line of code that doesn't seem to print correctly: toolStripStatusLabel1.Text =
I have this code and it should print labels with text boxes for people
I have this code where I want to read from a text file each
I have this code: <script type=text/javascript> var currenttime = '<? print date(F d, Y
I have this code that should open and read two text files, and match
I have this php code saved in text file, I want to convert this
I'd like my dictionary to be case insensitive. I have this example code: text
I have this regex code in python : if re.search(r\{\\fad|fade\(\d{1,4},\d{1,4}\)\}, text): print(re.search(r\{\\fad|fade\((\d{1,4}),(\d{1,4})\)\}, text).groups()) text
I have this code to verify whether an html text box is empty or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.