richtextbox

Windows.Forms.RichTextBox Loses table background colours

情到浓时终转凉″ 提交于 2019-11-30 04:53:34
问题 When loading a rtf file into a Windows Forms RichTextBox it loses the background colour of table cells. If we use a WPF RichTextBox and load the same file everything is formatted as it should. Am I missing something when I load the file into the Windows Forms RichTextBox? Windows Forms RichTextBox code snippet : private void button1_Click(object sender, EventArgs e) { OpenFileDialog fDialog = new System.Windows.Forms.OpenFileDialog(); fDialog.Filter = "Rich Text Files (*.rtf)|*.rtf"; fDialog

How can I use a RichTextBox as a NLog Target in a WPF application?

无人久伴 提交于 2019-11-30 04:47:58
问题 I read the following posts but neither helped to just get the same efficient way of printing logs from NLog onto a RichTextBox control target as in Winforms. How can I use NLog's RichTextBox Target in WPF application? WPF: Binding RichTextBox to Logger Output I also browsed the official forum but with no success (except suggestions to read the two above posts). The idea would be to add the target as: <target xsi:type="RichTextBox" name="console" layout="${longdate:useUTC=true}|${level

c# - perfect syntax highlighting [closed]

我们两清 提交于 2019-11-30 00:23:27
I'm looking for a RichTextBox with syntax highlighting! Sounds easy but I'm searching since months and didn't find that what I need. First I started to do it by myself... No good idea... I tried to use this: http://blogs.microsoft.co.il/blogs/tamir/archive/2006/12/14/RichTextBox-syntax-highlighting.aspx but that code don't handle loading files or pasting so i started to write a highlight function for inserting text-blocks. That tutorial and my code worked fine first, but then I saw a lot of tiny bugs and loading large files took too much time. Then a found a lot of similar tutorials/codes at

How do I scroll a RichTextBox to the bottom?

↘锁芯ラ 提交于 2019-11-29 23:26:13
I need to be able to scroll a RichTextBox to the bottom, even when I am not appending text. I know I can append text, and then use that to set the selection start. However I want to ensure it is at the bottom for visual reasons, so I am not adding any text. You could try setting the SelectionStart property to the length of the text and then call the ScrollToCaret method. richTextBox.SelectionStart = richTextBox.Text.Length; richTextBox.ScrollToCaret(); DrWu The RichTextBox will stay scrolled to the end if it has focus and you use AppendText to add the information. If you set HideSelection to

Highlight specific text in richtextbox

主宰稳场 提交于 2019-11-29 18:21:26
I have a window form that contain a listbox and some richtextboxex . listbox contains some values. When I select any value from listbox , richtextboxex bind with data according to selected value. I have to highlight some text which is bind to richtextbox when I select a value from listbox, e.g.: Just a friendly reminder that you have <<OverdueInvCount>> overdue invoice(s), with an overdue balance of <<OverdueInvTotal>>. If you have any questions about the amount you owe, please give us a call and we’ll be happy to discuss it. If you’ve already sent your payment, please disregard this reminder.

Problems implementing TinyMCE in CodeIgniter

◇◆丶佛笑我妖孽 提交于 2019-11-29 18:03:04
I am trying to implement TinyMCE in CodeIgniter. I've created a view file and called it from a controller. I have uploaded all files into my CI project folder and showed the path of the files. But it is not working. Here is the view file: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Full featured example</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <!-- TinyMCE --> <script type="text/javascript" src="<?php echo base_url()?>application/tinymce/jscripts

RichTextBox font set to all lines in C#

半城伤御伤魂 提交于 2019-11-29 17:08:15
I changed the font of a RichTextBox , but this change does not set to all of its characters properly. Indeed there exist two font for the RichTextBox and that is not beautiful. Is there a solution for this problem!? This code does not work correctly: this.richTextBox1.Font = new System.Drawing.Font("Maiandra GD", 12); Set the selection to the entire box and set the SelectionFont. this.richTextBox1.SelectionStart = 0; this.richTextBox1.SelectionLength = this.richTextBox1.SelectionLength; this.richTextBox1.SelectionFont = new System.Drawing.Font("Maiandra GD", 12); 来源: https://stackoverflow.com

How to find a TextRange in RichTextBox (between two TextPointers)

感情迁移 提交于 2019-11-29 16:23:30
In my System.Windows.Controls.RichTextBox, I would like to find a TextRange of a given word. However, it is not giving me the correct PositionAtOffset after the first found word. The first one is correct, and then for the next found words, the position is not correct. Am I using the correct methods? Loop through listOfWords Word= listOfWords[j].ToString(); startPos = new TextRange(transcriberArea.Document.ContentStart, transcriberArea.Document.ContentEnd).Text.IndexOf(Word.Trim()); leftPointer = textPointer.GetPositionAtOffset(startPos + 1, LogicalDirection.Forward); rightPointer = textPointer

How to show html contents with a RichTextBox?

拥有回忆 提交于 2019-11-29 14:45:39
I want to show html contents in my form. I tried to it with rich text box. rtBox.Text = body; but it fails. How to show html contents in RichTextBox? I am using VS 2008. If you've got HTML content, you could use the WebBrowser control - otherwise you will have to convert the HTML to RTF to render in the RichTextBox Use a hidden WebBrowser Control and load it with the html content you want. Then SelectAll() from the WebBrowser, Copy(), and Paste() into the richtextbox. WebBrowser wb = new WebBrowser(); wb.Navigate("about:blank"); string url=@"http:\\...."; wb.Navigate(url); private const int

Javascript - Change font color of certain text in textarea

拜拜、爱过 提交于 2019-11-29 14:19:08
问题 Is there any JS function that can change the color of certain text in a textarea? For example, blar blar {blar} blar, {blar}, including { }, will be in blue. Other words will be in blank. In other words, all I need is a function that can change color of all text in { }. I've done some studies and it seems that most people say it can't be done. But I'm seeing rich text editors or those wysiwyg editors having the ability to bold or underline words. There must be a way to do it. Any suggestion