richtextbox

C# converting RTF to html [duplicate]

て烟熏妆下的殇ゞ 提交于 2019-12-11 04:46:52
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Convert Rtf to HTML I'm trying to export text from a C# app to a Flash movie hoping to get the same formatted text. Flash can handle html tags, so my question is: Is it possible to convert formatted text from a RichTextBox into HTML using C#? Thanks 回答1: Yes it is possible, question has already been asked and answered: Convert Rtf to HTML 来源: https://stackoverflow.com/questions/6585376/c-sharp-converting-rtf-to

save the color of a text in a database and copy text with color into a richtextbox

无人久伴 提交于 2019-12-11 04:33:38
问题 I want to maintain the format of a text when i copy it into a richtextbox , How can i do this? (When you copy code in a microsoft word document, the color of the code will be the same as in Visual studio (show here http://img4.fotos-hochladen.net/uploads/unbenannta2k46fcjn5.png )) And i want to save the text in a sql database and reload it with the same format(colors, etc.). I know how to save and read data in a database but how can i save the text with the format(color)? 回答1: you could also

Example of using EM_STREAMOUT with c# and RichEditBox

情到浓时终转凉″ 提交于 2019-12-11 04:22:59
问题 i trying to get a text from a RichEdit field with WM_GETTEXT, but i run into some problems, so I found EM_STREAMOUT, this is especially for RichEdit. I found this code and played a little bit with it, but i can't get them to work: delegate uint EditStreamCallback(IntPtr dwCookie, IntPtr pbBuff, int cb, out int pcb); struct EDITSTREAM { public IntPtr dwCookie; public uint dwError; public EditStreamCallback pfnCallback; } [DllImport("user32.dll", CharSet=CharSet.Auto)] static extern IntPtr

How to get RichTextBox Undo to work better?

天大地大妈咪最大 提交于 2019-12-11 03:56:18
问题 I am trying to write a text editor using RichTextBox . My concern is now about Undo and possibly Redo features of RichTextBox. When I start writing in text box, say 1 minute! if I call Undo method, all it does is just I beleive clearing or resetting richtextbox again. How can I get it to work that it can do better, like Undoing last added word, or last added new line...I mean usual things you expect from Undo function. (The same counts for Redo also!) Is there properties or some options to

RichTextBox throws OutOfMemory on Azure

南笙酒味 提交于 2019-12-11 03:46:23
问题 I'm using RichTextBox to convert a string in RTF to plain text, using this piece of code: private string ConvertToText(string rtf) { if (string.IsNullOrWhiteSpace(rtf)) return string.Empty; if (!rtf.Contains("{\\rtf")) return rtf.Trim(); using (var helper = new System.Windows.Forms.RichTextBox()) { helper.Rtf = rtf; var plainText = helper.Text; if (string.IsNullOrWhiteSpace(plainText)) return string.Empty; return "<< Rule in Rich Text Format converted to Plain Text >>\n\n" + plainText + "\n\n

RichTextBox C# programmatically trigger certain functions

倾然丶 夕夏残阳落幕 提交于 2019-12-11 03:38:37
问题 I want to trigger the following functions programmatically in my RichTextBox Editor. I have this already: //Copy TextRange range = new TextRange(doc.Editor.Selection.Start, doc.Editor.Selection.End); Clipboard.SetText(range.Text); //Paste Editor.Paste(); // PageDown Editor.PageDown(); // PageUp Editor.PageUp(); //Text Size Editor.FontSize = number; //Undo Editor.Undo(); //Redo Editor.Redo(); I want to apply the following to the currently selected text on a RichTextBox: AlignLeft AlignRight

WPF RichTextBox word wrapping

流过昼夜 提交于 2019-12-11 03:28:57
问题 I am trying to display a large amount of data in a WPF RichTextBox control. My data contains space characters. There is a default word wrapping behavior that does not allow a "word", to be split and displayed on more lines. This behavior is triggered by having space characters, questions marks, full stops or any other sentence/word delimiter. In the example below, if you replace the space character with a letter ( ex: "X" ), everything will be displayed as expected. As no delimiter characters

Font limitation in MSAccess richtext edit tool

倖福魔咒の 提交于 2019-12-11 03:07:51
问题 Using MSAccess (2010+) richtext control. However, edit tool provides only limited number of font point sizes e.g. 6,8,10, 12; compared to editing within Word that provides e.g 8,9,10,11,12 This is driving my client mad as they wish to save text using 11pt - but this point size is not available. Has anybody else observed this issue and is there a possible solution 回答1: You can't select 11pt, because Access Richtext (actually HTML) doesn't store point sizes, but a fixed set of <font size=1> to

richtextbox to string

可紊 提交于 2019-12-11 03:07:00
问题 I have a richtextbox bound to a menu item to allow bold, italic and underline aswell as cut copy and paste. But how do you take the richtextbox content and turn it into a string from code behind which will carry the bold, italic etc? </DockPanel> <DockPanel Height="259" VerticalAlignment="Bottom"> <Menu DockPanel.Dock="Top"> <MenuItem Header="Edit"> <MenuItem Command="Cut" Header="_Cut" /> <MenuItem Command="Copy" Header="C_opy" /> <MenuItem Command="Paste" Header="_Paste" /> </MenuItem> <

Implementing search&highlight - how can I avoid delays when highlight is slow?

别来无恙 提交于 2019-12-11 02:36:28
问题 I have a RichText, and want to implement a highlighting search, like you see in VS or Chrome. I got a fairly-working implementation going: private void _txtSearch_TextChanged(object sender, EventArgs e) { new RichTextNode(richTextBox1).Highlight(_txtSearch.Text); } public void Highlight(string text) { textBox.BeginUpdate(); // Extension, implemented with P/Invoke textBox.SelectionStart = 0; textBox.SelectionLength = textBox.Text.Length; textBox.SelectionBackColor = textBox.BackColor; int