c# - WPF Richtextbox FontFace/FontSize -


I am currently trying to create some basic word processor features in a WPF project. I am using RichTextBox and have information about all editing commands (togglebold, toggletick ... ect.) The object I am stuck on allows the user to change fonts and font faces such as MS Office where the value only changes to the selected text and if there is no selected text, then the value will be changed to the current state of the situation. I have received a decent amount of code for working, but there is no problem with any of the selected text. I am here for RichTextBox. Selection.

  Text Selection Text = Rich Textbox Selection; If (text.IsEmpty) {// This will change the entire word that current Carat Status // does not have expected / expected result Text.ApplyPropertyValue (RichTextBox.FontSizeProperty, Value); } Else // This works as expected Text.ApplyPropertyValue (RichTextBox.FontSizeProperty, Value);  

So my question is how should I go about doing this? Is there a better / more convenient way to do this? One thought that I needed to insert a new inline in the paragraph but I did not understand how to do it. Any help is appreciated thanks.


Full Disclaimer : This is an exact repost of the question 7 months ago. I found it to be searching for a solution to the same problem, although the question was not answered and I hope someone will be able to answer it now. Try it out:

  Change Private ZeroTextproperty (Dependency Property DP,     String value) {returns (mainRTB == empty); Text selection TS = mainRTB.Selection; If (TSIASPTY) {LessonPorterCareType = Main RTBCrate; TextRange tr = new texture (carat piece, carat pOS); Tr.Text = ""; Tr.ApplyPropertyValue (DP, Value); } Else {ts.ApplyPropertyValue (DP, value); }}  

I hope this is the trick


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -