Apply changes before input text (richtextbox)
-
Hi, i'm making text editor in c# with wpf. The editor apply changes (bold, italic, fontsize) only text selected for user. how can I make the change occurs before typing the text in editor ?! Tnks
So, what you have in mind is that there is no text currently selected, but the Textbox has focus, and the insertion point is set somewhere, and you press a button, or something, and then the next characters you type are in bold, italic, etc., depending on what buttons you pressed ? What have you tried so far ? What are you doing now, in code, that sets the selected text to bold, italic, etc. ?
~ “This isn't right; this isn't even wrong." Wolfgang Pauli, commenting on a physics paper submitted for a journal
-
So, what you have in mind is that there is no text currently selected, but the Textbox has focus, and the insertion point is set somewhere, and you press a button, or something, and then the next characters you type are in bold, italic, etc., depending on what buttons you pressed ? What have you tried so far ? What are you doing now, in code, that sets the selected text to bold, italic, etc. ?
~ “This isn't right; this isn't even wrong." Wolfgang Pauli, commenting on a physics paper submitted for a journal
-
Then, remember Word when press "I" for the Italic the cursor change and the text to. In my case i need input text and after select all text e press "I" for changes. But i want to work as the Word. Now i use ApplyPropertyValue();
juliogyn wrote:
Now i use ApplyPropertyValue();
And, does that work for you ? If so, game-over.
~ “This isn't right; this isn't even wrong." Wolfgang Pauli, commenting on a physics paper submitted for a journal