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. Displaying italicized text on a dialog

Displaying italicized text on a dialog

Scheduled Pinned Locked Moved C#
question
3 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.
  • D Offline
    D Offline
    Dan Neely
    wrote on last edited by
    #1

    How can I do this? I assume italicizing one word in the middle of a sentence is beyond the capabilities of a label object, but haven't been able to find a way to do it using a (crippled) richtextbox either.

    F 1 Reply Last reply
    0
    • D Dan Neely

      How can I do this? I assume italicizing one word in the middle of a sentence is beyond the capabilities of a label object, but haven't been able to find a way to do it using a (crippled) richtextbox either.

      F Offline
      F Offline
      Febret
      wrote on last edited by
      #2

      First use the SelectionStart and SelectionLength properties of the control to select the part of the text you want to italicise, the go with this:

      [RichTextBox].SelectionFont =
      new System.Drawing.Font(
      [RichTextBox].SelectionFont,
      FontStyle.Italic);

      Hope it helps.

      D 1 Reply Last reply
      0
      • F Febret

        First use the SelectionStart and SelectionLength properties of the control to select the part of the text you want to italicise, the go with this:

        [RichTextBox].SelectionFont =
        new System.Drawing.Font(
        [RichTextBox].SelectionFont,
        FontStyle.Italic);

        Hope it helps.

        D Offline
        D Offline
        Dan Neely
        wrote on last edited by
        #3

        That looks like it should work. I was trying to do it in the designer since it's a static string.

        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