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. WPF
  4. How do you adjust leading between paragraphs in RichTextBox? [SOLVED THROUGH A KLUDGE]

How do you adjust leading between paragraphs in RichTextBox? [SOLVED THROUGH A KLUDGE]

Scheduled Pinned Locked Moved WPF
csharphtmlwpfarchitecturetutorial
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.
  • F Offline
    F Offline
    fjparisIII
    wrote on last edited by
    #1

    The RichTextBox in Silverlight 4 supports the Paragraph element. But if you just put two paragraphs in a row together, there is no leading between the paragraphs. Also, unlike WPF, the Paragraph element does not define a Margin property. If the first paragraph just happens to fill the last line (or nearly so), it looks as if there is only one paragraph and there is no visual clue that you actually have two paragraphs. So how do you control the leading between paragraphs? You get far too much leading if you end each paragraph with a LineBreak element, so that's not a solution, and it's a kludge to begin with. Solution: The only way to solve this is through a kludge. I bounced this solution off a Silverlight MVP and he thought this kludge was "clever." To provide leading between each paragraph in the BlockCollection of a RichTextBox, you can include markup like the following:

    <Paragraph FontSize="4"></Paragraph>

    when for example the font size of your paragraphs is 14. If you use the default font size for your paragraphs (11), a font size of 3 might work in the kludge.

    modified on Monday, May 24, 2010 3:36 PM

    A 1 Reply Last reply
    0
    • F fjparisIII

      The RichTextBox in Silverlight 4 supports the Paragraph element. But if you just put two paragraphs in a row together, there is no leading between the paragraphs. Also, unlike WPF, the Paragraph element does not define a Margin property. If the first paragraph just happens to fill the last line (or nearly so), it looks as if there is only one paragraph and there is no visual clue that you actually have two paragraphs. So how do you control the leading between paragraphs? You get far too much leading if you end each paragraph with a LineBreak element, so that's not a solution, and it's a kludge to begin with. Solution: The only way to solve this is through a kludge. I bounced this solution off a Silverlight MVP and he thought this kludge was "clever." To provide leading between each paragraph in the BlockCollection of a RichTextBox, you can include markup like the following:

      <Paragraph FontSize="4"></Paragraph>

      when for example the font size of your paragraphs is 14. If you use the default font size for your paragraphs (11), a font size of 3 might work in the kludge.

      modified on Monday, May 24, 2010 3:36 PM

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      Thanks for posting a solution here - even though it's a workaround.

      My signature "sucks" today

      modified on Tuesday, May 25, 2010 2:17 AM

      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