richtextbox

Default font for Rich Text field

感情迁移 提交于 2019-12-11 14:00:52
问题 In my xpages application, I have one comments field that is a rich text field. My users would like the default font to be Courier New. Yes, they can click the drop down and select Courier New, but they would like to be able to just start typing. I tried setting the style on the rich text control, but that didn't work. In the theme somehow maybe? Any thoughts? 回答1: in theory (to be honest, I've never done it myself) this can be done through the rt editor's configuration. Xpages by default come

Where does WPF's RichTextBox editor get it's spell checking from?

自闭症网瘾萝莉.ら 提交于 2019-12-11 12:53:26
问题 Does it use Microsoft Word's spellchecker? Thank you. 回答1: No, they are not part of Microsoft Word. They are part of WPF. It would be an inconvenience to developers to have a feature dependent on a Microsoft Word installation. Instead, it uses an embedded dictionary. WPF4 introduced functionality for custom dictionaries. 回答2: You didn't mention what you need it for. So here is a wild guess. You may want to check out: http://nhunspell.sourceforge.net/ NHunspell brings the spell checking,

C# scrolling of richtextbox

喜夏-厌秋 提交于 2019-12-11 12:52:36
问题 Is there a method to scroll the richtextbox to the top automatically with codes? Thanks! 回答1: you mean bottom? instance.SelectionStart = instance.Text.Length; or i guess top would be instance.SelectionStart = 0. 回答2: Set .SelectionStart =0 and then .ScrollToCaret(). 回答3: richTextBox.SelectionStart = richTextBox.Text.Length; richTextBox.ScrollToCaret(); tRY the above 2 lines of code it worked for me! 来源: https://stackoverflow.com/questions/4373433/c-sharp-scrolling-of-richtextbox

RichTextBox FormatBar in code behind

二次信任 提交于 2019-12-11 12:29:55
问题 Im looking at the codeplex WPF extended RTB and id like to perform the following in code behind: <RichTextBox> <toolkit:RichTextBoxFormatBarManager.FormatBar> <toolkit:RichTextBoxFormatBar /> </toolkit:RichTextBoxFormatBarManager.FormatBar> </RichTextBox> Im having brain drain, I have the following in my code behind but cant wire it up! Microsoft.Windows.Controls.RichTextBox rtb_wording = new Microsoft.Windows.Controls.RichTextBox();// USE extended RTB Microsoft.Windows.Controls

Display curly braces in RichTextBox when manually setting Xaml property

廉价感情. 提交于 2019-12-11 11:26:11
问题 I'm currently working on a Twitter app for Windows Phone, in which – via a custom DependencyProperty – the Xaml property of each RichTextBox is bound to the text of a tweet (which includes programmatically generated Run elements with all the text). This works good enough until there are curly braces { and } in the text. I tried replacing them with { and escaping with {} but to no avail. The weird thing is, if the curly braces show up in the middle of the text (more specifically, in the Text

Clear pageup/pagedown panning values after clear and reload content in wpf richtextbox?

僤鯓⒐⒋嵵緔 提交于 2019-12-11 10:24:26
问题 i am working in wpf richtextbox.use the below function use for page up. TextRange range10 = new TextRange(txtAppendValue.CaretPosition.GetLineStartPosition(1), txtptrCaret); FrameworkContentElement fce1 = (range10.End.Parent as FrameworkContentElement); if (fce1 != null) { fce1.BringIntoView(); range10 = null; fce1 = null; } its working.After i clear the richtextbox and load some other content,at that time the content shown where the pageup happened in last time?how to clear when i reload the

Handle Hyperlink Click event after load from Database in C# Richtextbox

 ̄綄美尐妖づ 提交于 2019-12-11 10:23:08
问题 I add document of Richtextbox to database. Document have several hyperlink. Every hyperlink added to this richtextbox by programmatically as follows: RichTextBox.IsDocumentEnabled = true; RichTextBox.IsReadOnly = true; Run run = new Run(RichTextBox.Selection.Text); Hyperlink hyp = new Hyperlink(run); WordMain main = new WordMain(); hyp.Click += new RoutedEventHandler(main.hyperLink_Click); hyp.NavigateUri = new Uri("http://search.msn.com"); RichTextBox.Cut(); var container = new

C# Rich text box highlight

时光总嘲笑我的痴心妄想 提交于 2019-12-11 10:00:12
问题 I have a rich text box and a font dialog box. The problem is that when i highlight a certain string or group of strings then open the dialog box, the highlight color disappears. Although the changes are successful (like if i change the font family of a highlighted string it changes). For aesthetic purposes i would like to retain the highlight color, then remove it whenever the changes are done. THANK YOU for the help! 回答1: The rich text box has a property called HideSelection which is true by

Controls in InlineUIContainer & BlockUIContainer always disabled in RichTextBox.Document

时光毁灭记忆、已成空白 提交于 2019-12-11 09:55:50
问题 For example if i have code like the following both Buttons are disabled: <RichTextBox> <FlowDocument> <BlockUIContainer> <Button Content="!"/> </BlockUIContainer> <Paragraph> <InlineUIContainer> <Button Content="!"/> </InlineUIContainer> </Paragraph> </FlowDocument> </RichTextBox> I have no idea why this is the case or what i can do to prevent this, obviously disabled buttons are not very useful so any help to resolve this would be appreciated. Edit: It turns out that the FlowDocument gets

How to change highlight colour of a portion of a text in rich text box?

送分小仙女□ 提交于 2019-12-11 09:51:55
问题 I am new to WPF's RichTextBox. I would like to know how to highlight text on a line with a specific colour. Let's say I have a rich text box with a yellow background and assign to it a flow document. richTextBox.Background = Brushes.LightYellow; var mcFlowDoc = new FlowDocument(); var para = new Paragraph(); para.Inlines.Add(new Run("This is the first line.\n")); para.Inlines.Add(new Run("This is the second line.\n")); para.Inlines.Add(new Run("This is the third line.")); mcFlowDoc.Blocks.Add