aetrio.blogg.se

Microsoft rich text control
Microsoft rich text control









microsoft rich text control

Microsoft rich text control code#

The main form class (frmMain.cs) is pretty easy to follow. It begins with a couple of import statements followed by the class declaration. The code is divided by purpose into four separate regions which are:

microsoft rich text control

Figure 2 shows the references as they exist in the project.

microsoft rich text control

Most notably, the extended rich text box control library is added to allow for the use of the extended rich text box control. In addition to the form classes mentioned, the solution also contains a folder entitled, "Graphics" this folder contains all of the image files used to support the application's menus and toolbar.Īside from the default references, there are a couple of additional references added. The second solution is the editor application itself (RichTextEditor). This application uses the extended rich text box control and then to that adds in all of the normal document manipulation techniques (such as font selection, indentation, and file IO support). Aside from the main application's form (frmMain.cs), this project also includes two additional forms, one to search for a string within the RTB's content, and one to search for and replace strings within the RTB. These forms are frmFind.cs and frmReplace.cs.įigure 4: Editor Application Find and Replace Dialog This control class was provided by Microsoft as an alternative to the basic Rich Text Box control the class inherits from the RichTextBox control class but adds to that base class additional support for printing the control's content. The approach provided by the control is far simpler than the traditional approach used as based upon the manipulation of the graphic context of the control. In order to get started, unzip the attachment and load the solution into Visual Studio 2005. Examine the solution explorer and note the files contained in the project:įigure 2: The Solution Explorer Showing the Project Filesįirst note that there are two separate projects contained in the solution. The first project is a class library entitled, "ExtendedRichTextBox", that library contains a single control class, "RichTextBoxPrintCtrl.cs". Whilst this project will not lead you to drop MS Word, it is a decent little word processor and to that end, you may find a use for it. I have always kept one of these on hand and have frequently tailored them to do things like provide a custom tool for viewing reports, error logs, and things of that nature when I wanted to integrate that feature into a product so that I could use it in lieu of doing something like shelling out a text file into Notepad. Doing so allows me to control the appearance of the application, the caption in the title bar of the form, etc. Implementing Alignment options in an RTB control











Microsoft rich text control