Graphic devexpress Richeditcontrol Use of rich Text, with source code and official API

Source: Internet
Author: User

9:30, just wrote to 1, 2. It's time to go home and finish writing tomorrow.

We still need what operation, message said, no I continue to add tomorrow.

Long time no play devexpress, today downloaded a play, found unexpectedly updated to 14.2.5. I'll go.

Topics in this chapter:

  1. Create Project, form build
  2. Add a toolbar to Richeditcontrol
  3. To create a custom toolbar button item
  4. Image parsing operations
  5. Correcting document fonts
  6. Content search function
  7. Import Export function (text/html/word)
  8. Official related API

Don't say much nonsense, get to the point.

I. Create project, form build

1. Create a new c#.net WinForms application and remove the default form:

2. Right-click Project-"ADD DevExpress Item"-"New Item ...":

3. Open the New DevExpress Entry window, select "Form", create a new DevExpress form item, name the form, here I set "Frmmain":

4. Expand Toolbox-"Rich Text editor", Find Richeditcontrol and drag and drop to form:

5. Set Richeditcontrol related properties:

> renamed Richeditcontrol, Name property changed to: "Richeditmain"

> Set the dock to fill the entire form with fill.

> Change the default text and modify the text value to "Welcome to the lone Shadow blog!" ”

> Remove the default ruler, set the Activeviewtype property to "simple", the control is more compact, the default is "printlayout" Printing format:

Second, add a toolbar to Richeditcontrol

Since it is a rich text editor, there are a few toolbar options like the blog Park Editor:

How do we set it up? Do you have to write one by one? Of course not.

DevExpress's Richeditcontrol provides us with very, very rich tool options, which are available in two ways.

The first is the form of the Ribbon menu:

The other is an option group in the form of a toolbar:

Personal feeling is still very good, according to the project needs to choose the specific type of. Here's how to add these two separately:

The first is the first option group in the Ribbon Stretch menu form:

With the Richeditcontrol control selected, the Black Triangle menu item appears in the upper-right corner, and a two-level menu option pops up when clicked:

We'll start by clicking on "Create Ribbon", creating a Ribbon menu, and then clicking the upper-right corner of the triangle again, and there are a lot of new options:

At a glance, the first "create all Tabs" must be for us to create all the menu options, and each of the following, such as "File Tabs", is the options related to the operation of the files, this according to the needs of everyone to add, I for the demonstration, add all:

Then, let's look at the option group in the form of a toolbar:

Then the rest of the Add option, and the above is the same, click on the small triangle again, select "Create ...." Tabs "can:

This is the Add tool option, isn't it very simple and powerful? Oh.

However, personal advice, do not want to appear so strong and all the same to add, otherwise it seems very messy.

Moreover, these options are already default with the event processing, basically do not need us to write other code, so, the use of what options to add, do not have to delete it.

Iii. Creating custom Toolbar Options

What about the funeral? Continue tomorrow ...

9:30, just wrote to 1, 2. It's time to go home and finish writing tomorrow.

We still need what operation, message said, no I continue to add tomorrow.

"This article from The lone Shadow ' Blog:http://www.cnblogs.com/lonelyshadow, the code word is not easy, reproduced please indicate the source." 】

Graphic devexpress Richeditcontrol Use of rich Text, with source code and official API

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.