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
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
Hi Matt,
This works fine in the Web formatted text editor, but not in the WinForms version. Could you provide some sample code to do this?
Thanks