richtextbox

Renderproblem RichTextBox Windows Phone 8

送分小仙女□ 提交于 2019-12-24 16:34:25
问题 I'm implemented a RichTextBox in WindowsPhone 8. I fill this Box while runtime with Paragraphs, Runs, Images and HyperlinkButtons. The Problem that now appears is after some lines of content the RichTextBox is cut. I declared a red border that is also cut. Links and images are still displayed. Here is a Screenshot: My XamlCode is simple: <Grid x:Name="LayoutRoot" Background="Transparent"> <ScrollViewer> <RichTextBox x:Name="ContentBox" HorizontalAlignment="Stretch" VerticalAlignment="Top"

ReadOnly content of RichTextBox doesn't show images

本小妞迷上赌 提交于 2019-12-24 13:37:26
问题 I've come across some strange behavior of RichTextBox . I want it to be readonly , but then it doesn't display images when I use richTextBox.LoadFile(path) method to load .rtf file. When it's not readonly the file is loaded correctly and the images are displayed. I am using Windows Forms. Can I make it up somehow or is it another RTB bug? For now, as a workaround I am using a label to move focus to it while my RTB got focus, but I don't really like this one. 回答1: you can create a custom

Rich text box in Crystal Reports

梦想的初衷 提交于 2019-12-24 12:14:25
问题 I have created rich text box in crystal reports for displaying product description. Everything is displaying properly but it is not taking more than 65534 characters. I need to display more than 65534, so please any one can help me to use is there any other control like richtext box to display the data. 回答1: This is a limitation of Crystal Reports. Your options in your query split the field in to multiple 65534 character length fields for each row (problem would be how many fields to produce

Detect when caret position changes in RichTextBox

安稳与你 提交于 2019-12-24 11:35:01
问题 I am trying to implement very simple text formatting functionality for a RichTextBox in WPF. This just consists of a few bold, italic, etc ToggleButtons just above the RichTextBox. See image below, but ignore the top TextBox - the RichTextBox is the bigger one at the bottom. Toggling formatting for either a selection or at the caret position (for text that will be typed in) is not a problem, as I'm doing this: private void BoldButton_Checked(object sender, RoutedEventArgs e) { this

C# WPF colorize specific words in RichTextBox text

雨燕双飞 提交于 2019-12-24 10:49:00
问题 I've a misunderstanding about FlowDocument, please help me to see clear. I'm working on a source code editor, where user can add few special variables, and later the program looking for this variables. For this editor, I'm using RichTextBox(RTB). I'd like to use color for these variables. It was not a problem to add color when the user add new variable to the text. But when the user open a source code what has already some variables first I've to go trough on the whole text and colorize the

How do I retain TextBox line breaks in Winforms after assigning text to a string variable?

自作多情 提交于 2019-12-24 10:13:21
问题 I have a WinForms app with a multi-line textbox. This displays and retains (after loading from the DB) line break characters fine. However if I assign the TextBox.Text value to a string variable and then re-assign the variable back to the TextBox.Text property, the line break characters are lost and replaced with a square character (can't past them here as they just paste as a line break!) I've tried: Replace("\n",vbcrlf) but to no avail. Can anyone suggest a solution? UPDATE** I haven't

Set WinForms RichTextBox as the source of a PrintDocument

守給你的承諾、 提交于 2019-12-24 09:33:08
问题 I want to print the contents of a RichTextBox, so I am trying make a PrintDocument out of the RichTextBox. But I dont find a way to convert a simple RichTextBox to a PrintDocument. Any ideas? 回答1: There's quite an extensive article on this on MSDN, Getting WYSIWYG Print Results from a .NET RichTextBox: if that's TLDR then there's a condensed version as a kb article, How to print the content of a RichTextBox control by using Visual C# .NET or Visual C# 2005 来源: https://stackoverflow.com

RichTextbox MaxLength too small

和自甴很熟 提交于 2019-12-24 07:35:31
问题 I need to open a text file with ~4MB in a RichTextBox, but the end of the text was "trimmed". How do I override a RichTextBox.MaxLength Int32 limit? 回答1: I'm not sure how much text RichTextBox can handle, but I believe MaxLength only applies to text the user enters. If you set .Text directly it should be able to go past MaxLength, unless MaxLength is already at the maximum. 回答2: The default for RichTextBox.MaxLength is 2GB, so with a 4MB file this is not going to be your problem. 回答3: Besides

Output multiple variables in one rich text box in c# [duplicate]

跟風遠走 提交于 2019-12-24 06:58:09
问题 This question already has answers here : Creating a newline in rich text box (2 answers) How to output variables to a rich text box one after the other in c#? (2 answers) Closed 2 years ago . void ClearAllRichtextboxes() { richTextBox3.Clear(); richTextBox5.Clear(); richTextBox6.Clear(); richTextBox9.Clear(); richTextBox10.Clear(); } ClearAllRichtextboxes(); if (comboBox5.Text == "Primer") { richTextBox5.Text = "This is the number of primer tins" + primer.ToString(); richTextBox6.Text = "This

Removing RichText Formatting from RichTextBox in Visual C#

别来无恙 提交于 2019-12-24 06:46:43
问题 I'm developing an advanced rich text editor in c# but have stumbled upon a problem that I can't seem to grasp. I have been trying to let users save their documents as Text files (plain text). By using the following: MyRichTextBox.SaveFile(filepath, PlainText); But the problem is that when they view that file (which should have been saved as plain text) in Notepad, it shows up with all of the RTF formatting codes whish makes their documents unreadable. Does anybody know of any other way to