richtextbox

Best way to implement a Parsing/Editable Richtextbox in WPF

I'm trying to implement (as a prototype initially), a richtextbox control which can be parsed in real time to apply certain formatting options to it. This is being done in WPF so I thought the best way to go about it would be to extend the existing rich text box control. I've run into the issue where it isn't documented well and the exa...

Understanding RTF and edit it with vb.net

I have this RichTextbox in my vb.net form and I would like to when a user click a button, for example to embold the selected text, how would I do this. Also, I do NOT want to use the standard vb.net expressions such as RichTextBox1.SelectedText.Font.Bold = true. I want to do something like RichTextbox1.SelectedRTF="[bold]" & RichTextBox...

Disable Drag&Drop of files in Richtextbox in .NET

Hello, I use a .NET richtextbox and I want to have the EnableAutoDragDrop property set to True. This allows user to drag&drop text, rtf and images around etc. However, I need to process files dropped into the richtextbox myself - I do not want them to be embedded as OLE objects when they are dropped. How can I overcome this? Is there ...

Edit and render RichText

We have an application (a custom network management tool for building automation) that supports printing labels that you can cut out and insert into the devices' front displays. In earlier versions of the tool (not developed in my company), the application just pushed the strings into an Excel file that the field technician could then ma...

RichTextBoxAppender using log4net

Is there a way to programatically create a RichTextBoxAppender using log4net? In other words no xml app.config? ...

How do I move the caret a certain number of positions in a WPF RichTextBox?

I want to move the caret 4 positions to the right of where my caret currently is. I'm registered for PreviewKeyDown, and calling InsertTextInRun() when the tab key is captured, like so: private void rtb_PreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Tab) { rtb.CaretPosition.InsertTextInRun(" "); ...

Silverlight 4 RichTextbox Paragraph Margin or similar?

Hi All, I'm trying to add bullets to the SL4 RichTextBox. Using the Run / Paragraph objects and adding the correct bullet child seems to be an easy approach. However, when I want to apply a bullet to an existing paragraph, I would like to indent the content of the paragraph. How can apply this kind of styling to the paragraph? The margin...

How to create a TextBox like RichTextBox in WinCE 5.0 OS (C#)?

Now I have the following ideas: 1.override TextBox's OnPaint Event,use Graphics to draw rich string-font; 2.use RTF to save and display the rich format. But I do not know which method is better or more difficult. In addition, there are other better way to do. Any ideas are inspiring! ...

WPF -- How can I disable the default EditingCommands behavior on my custom richtextbox?

I want to disable the majority of the built-in functionality of the WPF Richtextbox that is found in "EditingCommands" How can I go about disabling them? ...

Inline text box labels with WPF

I'm trying to reproduce the layout of some paper forms in a WPF application. Labels for text boxes are to be "inline" with the content of the text boxes, rather than "outside" like normal Windows forms. So, with an Xxxxxx label: +-----------------------------+ | Xxxxxx: some text written | | in the multiline input. | | ...

Change color of text within a WinForms RichTextBox

I have a RichTextBox that I write a string to every time I click a Form button. The string ends with a newline so each time I add a string, it appends to the bottom of the RichTextBox. Each string begins with the string "Long" or "Short" and ends with Environment.NewLine. I'd like to color each line red if it beings with "Long" and blue ...

Adding image to RichTextBox programatically does not show in Xaml property

Trying to add an image to a RichTextBox progamatically from a Stream. The image displays in the text box, however when reading the Xaml property there is no markup for the image. private void richTextBox3_Drop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { FileInf...

RTFTextBox Works on Windows, Mono Throws 'RTF Parsing Failure: Malformed Color Entry'

I have some C#.NET code to take a string containing custom color codes and use them show colorized text in a RichTextBox. It works great on Windows, but running under Linux on Mono 2.4.2.3 I get this error: RTF Parsing failure: Malformed color entry RTF Stream Info: Pos:324 Line:1 TokenClass:Text, Major:8, Minor:0, Param:-10000000, Tex...

Preventing a RichTextBox operation from being added to the control's Undo stack

Editing a RichTextBox control's text (more specifically, modifying selection font/color) programmatically seems to be tracked in the control's built in undo stack. Is there a way, short of writing my own undo/redo "manager", to prevent certain actions/operations from being added to the undo stack ? ...

WPF RichTextBox - Selected Block?

I am experimenting with the WPF RichTextBox and notice that I can itterate through the blocks that make up its document by looping through RichTextBox.Document.Blocks. What is the best way to get the Block that surrounds the caret? I can get the CaretPosition and the ElementStart and ElementEnd properties of each block but can't see ho...

In WPF RichTextBox, does overriding of Underline/Strikethrough work?

In a WPF RichTextBox, the effective style of a Run of text is a result of combining the properties defined on the Run with the properties it "inherits" from the enclosing Paragraph and finally the styles on the Document. So you can set FontWeight to Bold at any of those levels. You can also set it Bold on the Paragraph and then switch it...

Wpf- Is there a worth while way to add richtextbox capabilities (Bold, Italics, Underline, Strike-Through) to a control which inherits from textbox?

I am writing a text editor and had planned on using the richtextbox control however, the richtextbox's performance is abysmal. On even small documents the wpf richtextbox lags if you hold a key down. I do not need all of the features of the wpf richtextbox, but I do need rtf support. How can I implement this? ...

WPF FlowDocument - Absolute Character Position

I have a WPF RichTextBox that I am typing some text into and then parsing the whole of the text to do processing on. During this parse, I have the absolute character positions of the start and end of each word. I would like to use these character positions to apply formatting to certain words. However, I have discovered that the FlowDoc...

How to show number of a line in a RichTextBox C#

I am making a simple text and script editor with code highlighting. For that I use a RichTextBox. But I don't know how to make it show the lines' numbers on the left side, like in VS or Notepad++. Is there any solution? ...

Setting WPF RichTextBox width and height according to the size of a monospace font

I am trying to fit a WPF RichTextBox to exactly accommodate a grid of characters in a particular monospace font. I am currently using FormattedText to determine the width and height of my RichTextBox, but the measurements it is providing me with are too small--specifically two characters in width too small. Is there a better way to per...