richtextbox

Is it possible to make an advanced rich text editor for web that would allow copy-pasting of pictures?

The long story: The larger problem is that I'm trying to convince people from switching away from Outlook to a more sane bugtracker, preferably web-based that we could also use as a public bugtracker. But the current argument against it is that the Outlook editor (which is really Word with all the bells and whistles) allows easy inserti...

Detecting hyperlinks in WPF RichTextBox

Hey folks, I'm wanting to write some rudimentary support for detecting hyperlinks in a WPF RichTextBox control. My plan is to use a regex to identify any links and then manually replace them with real hyperlink objects. However the part I am having trouble with is getting the correct textpointers, etc. once I find a link. For example, I...

Can't change input language of RichTextBox (WPF)

Hi, I'm trying to add to my RichEditBox'd tool bar a button to switch languages, like in MS Word. I can't seems to make this work. When I use the keyboard (alt+shift) I can switch between Hebrew and English without any problem, but the code below (and many other options I tried) is not working. The last commented line didn't work either...

What is the current king of the hill for rich text textarea editors?

Hi all, Just wondering: what is the current king of the hill for rich text textarea editors? Last time i checked (years ago) it was TinyMCE, is there a better option now? Thanks a lot ...

Open file in rich text box with C#

This question have been answered. I recommend sumit_programmers solution below. For now, I've removed my code, thinking it's more confusing than helpful. When I've developed it a bit further, perhaps I'll post my code here, with some comments. You may also be interested in the answer to the question Save text from rich text box with C#....

Save text from rich text box with C#

This question has been answered. I've improved the code a bit (at least I think so). It now reminds of the aceepted answer to the question Open file in rich text box with C#. If I haven't made any mistakes (which I may have), the code should save a file with text from the rich text box rtfMain. The default file extension is .txt. You can...

Error Cannot serialize a nested public type. why?

In the performance of this code is an error Cannot serialize a nested public type 'System.Windows.Forms.AxHost+State'. FlashControl my usercontrol <UserControl x:Class="Adminka.UserControls.FlashControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/win...

Remove images from RichTextBox FlowDocument

I have a WPF application on wich the user can paste some data from Word inside a RichTextBox... but if that word data has an image, I need to remove it, how can I acomplish that? Since the FlowDocument is xml, maybe doing some linq magic could do it, but I don't know how :/ ...

Coloring Text in RichtextBox, C#

How can I color new line of text with some different colors and then add it to RichTextBox? I'm using SilverLight. ...

backcolor of readonly richtextbox

I have a winforms app with a series of textboxes and one rich textbox. Upon a button click I would like to set all the fields to being readonly. The only issue with this is that the background color of a readonly richtextbox is white as opposed to the grey used by the textboxes. I have tried setting the backcolor property of the richte...

Problem for copyn'g from rtf in richtextbox

I have a problem when copying from rtf in richtextbox when serializing lost property. // NOT SERIALIZE properties "bold" and "color" and "size" All code: string ConvertXamlToString(FlowDocument fd) { string format = "@TAG@{0}:{1}@TAG@"; FlowDocument ss = new FlowDocument(); for (int i = 0; i < fd.Blocks.Count; i++) { var block...

RichTextBox Save "Selection Direction"

Hi. I have a WinForms program where, whenever you change your selection, the RichTextBox needs to change the colour of certain other text. In order to do this, it has to select that text, and therefore I lose my current selection. I can save and load the SelectionStart and SelectionLength properties, but I can't keep the "selection dire...

Referring To Named Elements Created Programmatically?

Hi Stack-O I have a RichTextBox created programmatically with the following code: RichTextBox RT = new RichTextBox(); RT.Name = "asdf"; RT.Text = "blah"; TableLayoutPanel.Controls.Add(RT,0,0); Now let's say I want to modify the text of RT, and it's name is "asdf", Visual Studio won't allow me to write asdf.Text = "haha" because asdf...

Why RichTextBox with ProggyClean font changes to Arial?

Hi, I try to use ProggyClean font in RichTextBox. Setting Font property (design time) and filling with text (runtime) works fine. When I start writing the text, font changes to default Arial. I have installed three different languages in the system: EN English (American) FR French (France) PL Polish What I have observed: Prog...

Guarding against unclosed html comment tag in rich text editor

I have an infragistics rich text editor that is breaking the rest of the page with data containing unclosed comment tag like: <style> <!-- /* Font Definitions */ --</style> Is there a good way to prevent this? (I'm thinking post save-data, as I'm not even sure this component is customisable before saving the data). ...

Store arbitrary application data in System.Windows.Forms.RichTextBox

Hello, Does anyone know of a way to store arbitrary data in a RichTextBox without the user being able to see this data? The 2007 RTF specification includes annotations ("\atnid", "\atnauthor", "\annotation", etc.) but whenever I insert these into a RichTextBox's .Rtf, the annotations disappear (presumably because the RichTextBox doesn'...

Convert Drawing.Bitmap to Imaging.Metafile - Pixel Perfect

Hello, I'm trying to convert a Drawing.Bitmap to an Imaging.Metafile for the purposes of inserting the metafile into a Forms.RichTextBox. (For reference, embedding a bitmap in a metafile is the recommended practice for putting a bitmap into richtext (see Rich Text Format (RTF) Specification Version 1.9.1, p. 149.) Unfortunately it als...

Faster Way to Color All Occurences in a RichTextBox in C#

Hi, I have a RichTextBox, and there are about more than 1000 occurrences of a specified search string. I use the following function to color all the occurrences: public void ColorAll(string s) { rtbxContent.BeginUpdate(); int start = 0, current = 0; RichTextBoxFinds options = RichTextBoxFinds.MatchCase; start = rtbxCo...

How to use EM_CHARFROMPOS with RichTextBox in C#

I am trying to use following code to retrieve character index by position in a RichTextBox. I know I can use GetCharIndexFromPosition method provided by RichTextBox Class, but I want to know what is wrong with following code: SendMessage import is this: [DllImport("User32.dll", EntryPoint = "SendMessage", CharSet= CharSet.Auto)] public...

C#: Displaying text in richtextbox in reverse order/updwards

Hi, I am trying to create a 'log display' using the richtextbox control in C#.NET. public void logLine(string line) { rtxtLoginMessage.AppendText(line + "\r\n"); } Is there a way to display the text in reverse order/upwards? (where the newest log and date will be displayed at the top) Your help is much appreciated. ...