WPF spellcheck richtextbox retry
Multi tool use
I'm currently embedding WPF into my C# project for it to spell check, but I've stumbled onto quite an odd issue.
As you can see, I have an empty RichTextBox
I embedded a WPF rich text box to C# like this:
System.Windows.Controls.RichTextBox richTextBox1 = new System.Windows.Controls.RichTextBox();
elementHost1.Child = richTextBox1;
omschrijving.SpellCheck.IsEnabled = true;
Now here is where the odd part begins:
[Working] Example 1: (here I load an .rtf
file into my textbox)
TextRange range = new TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd);
FileStream stream = new FileStream("file_example.rtf", FileMode.Create, FileAccess.Write, FileShare.None);
range.Load(stream, DataFormats.Rtf);
stream.Close();
[Not working] Example 2: (here I load a .txt
file into my textbox)
TextRange range = new TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd);
FileStream stream = new FileStream("file_example.txt", FileMode.Create, FileAccess.Write, FileShare.None);
range.Load(stream, DataFormats.Text);
stream.Close();
[Not working] Example 3: (here I don't load a file, because I don't need to, instead I just pass the string)
new System.Windows.Documents.TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd).Text = omschrijving_temp;
[Not working] Example 4: (here I don't load a file, because I don't need to, instead I just append the string)
omschrijving.AppendText(omschrijving_temp);
Example 1 loads the text into the RichTextBox
, and then shows red dots on the text (spelling errors).
Example 2 loads the text into the RichTextBox
, and then ignores the spelling check.
Example 3 loads the text into the RichTextBox
, and then ignores the spelling check.
Example 4 loads the text into the RichTextBox
, and then ignores the spelling check.
In all the examples above, when I type in the RichTextBox
(after the text is appended), the spelling check works perfectly,
but it ignores the spelling check for the automatically added text.
When appending text to the RichTextBox
it seems to work only when it's in a .RTF
(richtext) format; otherwise it just ignores the spelling check.
Is there any fix, is this a bug? or?
c# wpf
add a comment |
I'm currently embedding WPF into my C# project for it to spell check, but I've stumbled onto quite an odd issue.
As you can see, I have an empty RichTextBox
I embedded a WPF rich text box to C# like this:
System.Windows.Controls.RichTextBox richTextBox1 = new System.Windows.Controls.RichTextBox();
elementHost1.Child = richTextBox1;
omschrijving.SpellCheck.IsEnabled = true;
Now here is where the odd part begins:
[Working] Example 1: (here I load an .rtf
file into my textbox)
TextRange range = new TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd);
FileStream stream = new FileStream("file_example.rtf", FileMode.Create, FileAccess.Write, FileShare.None);
range.Load(stream, DataFormats.Rtf);
stream.Close();
[Not working] Example 2: (here I load a .txt
file into my textbox)
TextRange range = new TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd);
FileStream stream = new FileStream("file_example.txt", FileMode.Create, FileAccess.Write, FileShare.None);
range.Load(stream, DataFormats.Text);
stream.Close();
[Not working] Example 3: (here I don't load a file, because I don't need to, instead I just pass the string)
new System.Windows.Documents.TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd).Text = omschrijving_temp;
[Not working] Example 4: (here I don't load a file, because I don't need to, instead I just append the string)
omschrijving.AppendText(omschrijving_temp);
Example 1 loads the text into the RichTextBox
, and then shows red dots on the text (spelling errors).
Example 2 loads the text into the RichTextBox
, and then ignores the spelling check.
Example 3 loads the text into the RichTextBox
, and then ignores the spelling check.
Example 4 loads the text into the RichTextBox
, and then ignores the spelling check.
In all the examples above, when I type in the RichTextBox
(after the text is appended), the spelling check works perfectly,
but it ignores the spelling check for the automatically added text.
When appending text to the RichTextBox
it seems to work only when it's in a .RTF
(richtext) format; otherwise it just ignores the spelling check.
Is there any fix, is this a bug? or?
c# wpf
What isomschrijving
? Something likeApplication
? Do you meanSystem
?
– Scott
Jan 24 at 20:43
add a comment |
I'm currently embedding WPF into my C# project for it to spell check, but I've stumbled onto quite an odd issue.
As you can see, I have an empty RichTextBox
I embedded a WPF rich text box to C# like this:
System.Windows.Controls.RichTextBox richTextBox1 = new System.Windows.Controls.RichTextBox();
elementHost1.Child = richTextBox1;
omschrijving.SpellCheck.IsEnabled = true;
Now here is where the odd part begins:
[Working] Example 1: (here I load an .rtf
file into my textbox)
TextRange range = new TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd);
FileStream stream = new FileStream("file_example.rtf", FileMode.Create, FileAccess.Write, FileShare.None);
range.Load(stream, DataFormats.Rtf);
stream.Close();
[Not working] Example 2: (here I load a .txt
file into my textbox)
TextRange range = new TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd);
FileStream stream = new FileStream("file_example.txt", FileMode.Create, FileAccess.Write, FileShare.None);
range.Load(stream, DataFormats.Text);
stream.Close();
[Not working] Example 3: (here I don't load a file, because I don't need to, instead I just pass the string)
new System.Windows.Documents.TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd).Text = omschrijving_temp;
[Not working] Example 4: (here I don't load a file, because I don't need to, instead I just append the string)
omschrijving.AppendText(omschrijving_temp);
Example 1 loads the text into the RichTextBox
, and then shows red dots on the text (spelling errors).
Example 2 loads the text into the RichTextBox
, and then ignores the spelling check.
Example 3 loads the text into the RichTextBox
, and then ignores the spelling check.
Example 4 loads the text into the RichTextBox
, and then ignores the spelling check.
In all the examples above, when I type in the RichTextBox
(after the text is appended), the spelling check works perfectly,
but it ignores the spelling check for the automatically added text.
When appending text to the RichTextBox
it seems to work only when it's in a .RTF
(richtext) format; otherwise it just ignores the spelling check.
Is there any fix, is this a bug? or?
c# wpf
I'm currently embedding WPF into my C# project for it to spell check, but I've stumbled onto quite an odd issue.
As you can see, I have an empty RichTextBox
I embedded a WPF rich text box to C# like this:
System.Windows.Controls.RichTextBox richTextBox1 = new System.Windows.Controls.RichTextBox();
elementHost1.Child = richTextBox1;
omschrijving.SpellCheck.IsEnabled = true;
Now here is where the odd part begins:
[Working] Example 1: (here I load an .rtf
file into my textbox)
TextRange range = new TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd);
FileStream stream = new FileStream("file_example.rtf", FileMode.Create, FileAccess.Write, FileShare.None);
range.Load(stream, DataFormats.Rtf);
stream.Close();
[Not working] Example 2: (here I load a .txt
file into my textbox)
TextRange range = new TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd);
FileStream stream = new FileStream("file_example.txt", FileMode.Create, FileAccess.Write, FileShare.None);
range.Load(stream, DataFormats.Text);
stream.Close();
[Not working] Example 3: (here I don't load a file, because I don't need to, instead I just pass the string)
new System.Windows.Documents.TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd).Text = omschrijving_temp;
[Not working] Example 4: (here I don't load a file, because I don't need to, instead I just append the string)
omschrijving.AppendText(omschrijving_temp);
Example 1 loads the text into the RichTextBox
, and then shows red dots on the text (spelling errors).
Example 2 loads the text into the RichTextBox
, and then ignores the spelling check.
Example 3 loads the text into the RichTextBox
, and then ignores the spelling check.
Example 4 loads the text into the RichTextBox
, and then ignores the spelling check.
In all the examples above, when I type in the RichTextBox
(after the text is appended), the spelling check works perfectly,
but it ignores the spelling check for the automatically added text.
When appending text to the RichTextBox
it seems to work only when it's in a .RTF
(richtext) format; otherwise it just ignores the spelling check.
Is there any fix, is this a bug? or?
c# wpf
c# wpf
edited Jan 24 at 20:43
Scott
15.9k113990
15.9k113990
asked Jan 23 at 23:58
ImNoSTNImNoSTN
61
61
What isomschrijving
? Something likeApplication
? Do you meanSystem
?
– Scott
Jan 24 at 20:43
add a comment |
What isomschrijving
? Something likeApplication
? Do you meanSystem
?
– Scott
Jan 24 at 20:43
What is
omschrijving
? Something like Application
? Do you mean System
?– Scott
Jan 24 at 20:43
What is
omschrijving
? Something like Application
? Do you mean System
?– Scott
Jan 24 at 20:43
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1397693%2fwpf-spellcheck-richtextbox-retry%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1397693%2fwpf-spellcheck-richtextbox-retry%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
th T5Adn dYJW,EwsBrBi6vDXU EW9O APOQsQ7xHf29 4c5 gJINNF,jB
What is
omschrijving
? Something likeApplication
? Do you meanSystem
?– Scott
Jan 24 at 20:43