Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to transfer text to label from richtextbox

How to transfer text to label from richtextbox

Scheduled Pinned Locked Moved C#
tutorialhelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sokka93
    wrote on last edited by
    #1

    Hello, I have been trying to transfer text to a label from richtextbox. The problem is I can't equalize font and text color. For example, if I write "Hello World!" it seems the same on label but when I write "Hello World!" it seems "Hello World!". Is there a way to equalize them? Thanks in advance.

    L 1 Reply Last reply
    0
    • S Sokka93

      Hello, I have been trying to transfer text to a label from richtextbox. The problem is I can't equalize font and text color. For example, if I write "Hello World!" it seems the same on label but when I write "Hello World!" it seems "Hello World!". Is there a way to equalize them? Thanks in advance.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      label1.Text = richTextBox1.Text;
      label1.Font = richTextBox1.Font;

      A label is limited to using a single font to display it's text. That means one color, one font-family, one style. There are some custom components on the internet that can display RTF, or you can use the RichTextBox itself to display it.

      I are troll :)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups