New features abound. The XtraRichEdit Suite for v2009 volume 3 contains some new features, including bookmarks, hyperlinks, ruler support, multiple document formats, line numbering and selection drag and drop. This blog post shows you how to use the built-in Bookmark and Hyperlink dialogs and features of the RichEditControl. This is a no code solution and to use it you just need to complete some pretty straight forward steps.
To reproduce the demo add a Windows Form to a Windows project. Follow these steps:
1. From the Toolbox expand the DX.9.3: Rich Text Editor tab and drag and drop a RichEditControl onto the form
2. From the DX.9.3: Navigation & Layout tab of the Toolbox add a BarManager component to the form
3. Click the RichEditControl’s Tasks menu and click Create Links Bar; this will add the Bookmark and Hyperlink toolbar items to the form and a RichEditBarController component to the component’s section of the form
4. Run the demo
Add some text to the RichEditControl at runtime—see Figure 1. Select the text that represents the bookmark area—for example the word Bookmark just above the dialog—and click the Bookmark toolbar button (upper left). Provide a Bookmark name, for example, Bookmark and click Add—see Figure 2. Close the Bookmark dialog. To add a hyperlink in the text to the bookmark click the text for the hyperlink and click the hyperlink button or right-click and select Hyperlink from the RichEditControl’s runtime context menu. Add the text to display—which will be the selected text by default—provide a ScreenTip, in the Link to region select the “Place in this document” radio button and select the Bookmark from the drop down list—see Figure 3. The hyperlink will be visible at the selected location, and pressing Ctrl+Click will jump the focus from the hyperlink to the defined bookmark—see Figure 4.
Figure 1: Some text and graphics in the RichEditControl.
Figure 2: Click the Bookmark toolbar button to display the built-in bookmark definition.
Figure 3: Use the Hyperlink toolbar button or context menu to define a hyperlink in the text that will jump to the user-defined bookmark.
Figure 4: The finished document with the hyperlink; Ctrl+Click automatically takes the user to the defined bookmark location.