Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
UltraFormattedTextEditor and text-align
posted

Hi,

I have an editor that I'm trying to get alignment to work properly and I cant seem to get anything but the entire page/block to work. If I use txtEditor.EditInfo.ApplyStyle("text-align:Right", True) this works for the entire page but if I select some text/lines in my editor with the last param set to "False" nothing happens. Am I wrong in thinking that this code should work like all other formatting options (bold/font/etc) or is there some trick to getting selected text to have different alignment properties?

Any help would be great!

amy

Parents
No Data
Reply
  • 37774
    posted

    Amy,

    The text align setting will only apply to something like a paragraph tag and you can't use it just on a few lines; this is the same behavior that you will see in Word, where even if you select a few lines in a paragraph tag, changing the alignment will change that of the entire paragraph.  On the same token, pressing Enter in the UltraFormattedTextEditor will insert a <br> tag and will not create a <p/> tag, so the styles will still apply to everything.  I suppose you could alter the KeyActionMapping of the Enter key to use a <p> tag, or handle the KeyDown yourself to perform this logic.

    -Matt 

Children