richtextbox

How to change the font of multiple sizes in richtextbox in C#?

試著忘記壹切 提交于 2019-12-12 15:06:38
问题 I have a richtextbox and I would like to make it work like WordPad. My problem is that, for example, if I type "123" using the Calibri font, and then "456" using the Arial font and I want to change the size of 2345 it won't let me to do it because they have two different font types. This is where I have the problem: private void combo_sizes_TextChanged(object sender, EventArgs e) { if (rtb.SelectionFont == null) { rtb.SelectionFont = new Font(combo_fonts.Text, Convert.ToInt16(combo_sizes.Text

Rich Text Box how to highlight text block without select

為{幸葍}努か 提交于 2019-12-12 14:31:17
问题 I need a certain portion of my text in RTB to be highlighted not in the sense of changing the font style/color, but in the sense of making a block selection with a particular color. This is similar to how Visual Studio highlights a line during debug mode. The important thing here is to achieve the mentioned feature WITHOUT using richtextbox.select function, because the richtextbox I have is being periodically updated and if it calls the select function on each update, the user will have a

Regex Split at beginning of line containing word

笑着哭i 提交于 2019-12-12 13:01:06
问题 I'm trying to split a text into paragraphs each time a line contains a certain word. I already managed to split the text at the beginning of that word, but not at the beginning of the line containing that word. what's the right expression? this is what I have string[] paragraphs = Regex.Split(text, @"(?=INT.|EXT.)"); I also want to lose any empty paragraphs in the array. this is the input INT. LOCATION - DAY Lorem ipsum dolor sit amet, consectetur adipiscing elit. LOCATION - EXT. Morbi cursus

Is there an open source javascript rich text editor similar to gmail's? [closed]

荒凉一梦 提交于 2019-12-12 10:09:18
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I've looked at free javascript html editors, and I haven't found any that I feel handle links intuitively. I like the way the gmail editor does it (also the same way blogger.com) does it. Does anyone know if there is an open source editor that handles linking that way? Jquery would be preferable. 回答1: I use

How can I make a RichTextBox scroll to the end when I add a new line?

邮差的信 提交于 2019-12-12 07:25:11
问题 I have several read only RichTextBox's that are used for logging output. Since they're read only they don't seem to automatically scroll when the text is updated. I can use the TextChanged event to force a scroll to end, but is there not simply a way to set a property or something in the XAML so that scrolling happens like normal? 回答1: I had googled for your problem and found this post. In the section "Programming the RichTextBox" author had described about getting the behavior what you had

RichTextBox color

℡╲_俬逩灬. 提交于 2019-12-12 05:49:19
问题 I wish color of text was e.g green when user inputs it into RichTextBox control. I use sth like: private void richTextBox1_TextChanged(object sender, CancelEventArgs e) { RichTextBox richTextBox1 = sender as RichTextBox; richTextBox1.SelectionBackColor = Color.AliceBlue; } But it cause that first sign is in normal background, and starting from second sign whole eneterd text is blue: pattern(upper case is colored): eNTERED TEXT 回答1: Instead of TextChanged try it on OnKeyDown 回答2: I presume you

Application Slow After Change fontsize in a WPF richtextbox?

落花浮王杯 提交于 2019-12-12 05:18:03
问题 i am working with WP richtextbox.i done to navigate each line from current caret position to nextline,previousline etc.it works fine.i need to dynamically change fontsize in richtextbox. i used this below methods to change font size: myrichtextbox.SetValue(TextElement.FontSizeProperty, fontSizedouble +10); myrichtextbox.FontSize = (txtAppendValue.FontSize + 10); it works.But after execute this methods,the other functionality execution time taken is high.Before that NavigateNextLine() taken

How to get whether richtextbox last word is BringIntoView(shown) or not in WPF?

谁都会走 提交于 2019-12-12 05:13:10
问题 i am working in wpf,i have a richtextbox with some contents.if the contents are exceeded to richtextbox i want to hide bottom border.if the content within the richtextbox i want to show the bottom border.Now i am using the below code to bring the exceeded content to view in richtextbox. FrameworkContentElement fce = (startPos.Parent as FrameworkContentElement); if (fce != null) { fce.BringIntoView(); } But i want to display the bottom border,once the last word shown in that richtextbox.How to

How do I set formatted text in Silverlight RichTextBox?

社会主义新天地 提交于 2019-12-12 05:00:49
问题 How can I make a RichTextBox show a string with format? I'm using Run but it dosen't work: // create a paragraph Paragraph prgParagraph = new Paragraph(); prgParagraph.FontFamily = new FontFamily("Comic Sans MS"); // create some text, and add it to the paragraph Run rnMyText = new Run(); rnMyText.Text = w.meaning; prgParagraph.Inlines.Add(rnMyText); rtxtMeaning.Blocks.Add(prgParagraph); 回答1: I know that this question is a couple years old, but I had the same question and here's what I came up

RichTextBox Formatting Not Correct

一笑奈何 提交于 2019-12-12 04:56:53
问题 So I'm grabbing content from a JSON file and appending each item to a rich text box control. However, when I append and modify the look...it randomly looks like... Of course the one in the middle is formatted correctly, it's the ones on the outside that aren't. It's completely random also. Some will work, others won't. That's what's throwing me off. Here's the code... private void getNews() { WebClient newsClient = new WebClient(); Stream newsStream = newsClient.OpenRead("http://example.com