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. WCF and WF
  4. React on RichTextBox changes

React on RichTextBox changes

Scheduled Pinned Locked Moved WCF and WF
javascripttutorialquestion
3 Posts 2 Posters 6 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.
  • E Offline
    E Offline
    elektrowolf
    wrote on last edited by
    #1

    I have a RichTextBox containing a FlowDocument. Now I want to change the formatting of the currently focused inline when the text is changed. Unfortunately, the Span element does not have a TextChanged-event or something like that. So I have to use the RichTextBox' TextChanged-event. But how to access the selected element (Span, Paragraph, ....)?

    P 1 Reply Last reply
    0
    • E elektrowolf

      I have a RichTextBox containing a FlowDocument. Now I want to change the formatting of the currently focused inline when the text is changed. Unfortunately, the Span element does not have a TextChanged-event or something like that. So I have to use the RichTextBox' TextChanged-event. But how to access the selected element (Span, Paragraph, ....)?

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      You can get it using this:

      Run spans = XAMLRichBox.Selection.Start.Parent as Run;

      Deja View - the feeling that you've seen this post before.

      My blog | My articles

      modified on Tuesday, April 29, 2008 4:33 PM

      E 1 Reply Last reply
      0
      • P Pete OHanlon

        You can get it using this:

        Run spans = XAMLRichBox.Selection.Start.Parent as Run;

        Deja View - the feeling that you've seen this post before.

        My blog | My articles

        modified on Tuesday, April 29, 2008 4:33 PM

        E Offline
        E Offline
        elektrowolf
        wrote on last edited by
        #3

        Thx, works so far. But there's another problem: In XAML, I add a Paragraph to the FlowDocument. At runtime, I dynamically add some spans containing runs to the RTB. If I change the text, it seems like there is a new Run being created right in the Paragraph instead of the Span. Why doesn't he modify the existing Run? :confused:

        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