Our third new Toolkit control is the KryptonRichTextBox. As we have only just added the KryptonTextBox it makes sense to also add the rich version as well. The implementation works in the same way as previously, with a real WinForms RichTextBox embedded inside a Krypton Toolkit control.

Here it is in full techno-color…

The bottom instance has been given some RTF by assigning to the KryptonRichTextBox.Rtf property. Hence it shows using a variety of font settings and colors and also explains why it is not drawing in the same anti-aliased way as the other instances. I just creating some text in WordPad and exported it to a .rtf file. Then in the constructor of the samples I load the file into the control instance via the Rtf property.

I have exposed almost all the properties, methods and events as are present on the actual underling control and so you should be able to use it as a simple plug replacement for the original RichTextBox. But there might be some circumstances that you want direct access to the embedded control. You can do this using the KryptonRichTextBox.RichTextBox property.

For example the drag and drop set of events cannot be exposed via the actual Krypton control because that would be entirely to confusing. But you can hook into them in your code using KryptonRichTextBox.RichTextBox.DragEnter.

4 Responses to “KryptonRichTextBox”

  1. Lewis Says:

    I don’t understand your explanation on the lack of anti-aliasing. Isn’t the underlying RichTextBox control drawing the text? When I use the normal control, it anti-aliases just fine.

  2. Phil Wright Says:

    When Krypton does its own drawing it has the change to define the level of anti-aliasing that occurs for the font. When you use the TextBox or RichTextBox you can only specify a font and you cannot specify the anti-aliasing that occurs. Instead you get whatever the is appropriate for that font and defined by your system settings.

    So with a KryptonLabel control I can specify Times New Roman as the font and then specify if I want anti-aliasing or not. With the TextBox if you provide Times New Roman you have no control over if the control decides to use anti-aliasing or not.

  3. Mark Monster Says:

    Is there going to be a KryptonRichLabel too?

  4. Phil Wright Says:

    I have no plans on a rich label.

Leave a Reply