65.9K
CodeProject is changing. Read more.
Home

Text Editor Using C#

starIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIconemptyStarIcon

1.69/5 (13 votes)

Aug 3, 2007

CPOL

1 min read

viewsIcon

83389

downloadIcon

3857

Text Editor for typing a new document, article, news, etc.

Introduction

This is an old style text editor that is still being used in some applications. The aim is to type a document, article, or news for users who perfectly remember using DOS commands in the past.

This text editor looks like a Pascal or C++ application under DOS, with a blue color background, white forecolor text, and is limited to 80 characters per line.

But don't look down on it; even though it looks very simple and has a flat interface, this cool text editor has many features that will give it more credit from your point of view. Here are some of the features that are available:

  • Font size
  • Fore color
  • Back color
  • Spelling checker

Screenshot - text_editor.jpg

If you want to add more features, no problems.. just follow the sample inside the code.

Using the code

This article provides the source code on the top; you can download it and see that there are two projects to build this text editor:

  1. Best.Editor
  2. Best.Main

You need to run the project under the Best.Main folder, and inside it, find the main form which calls the user control from the Best.Editor project.

Basically, the control that is used for typing text is a RichTextBox. Then, with your creativity to enhance it, define properties that will be give new features to this text editor.. example: alignment, save as, print, etc.

protected Color foreColor;
public Color z_ForeColorget 
{
    get
    {
        return foreColor;
    }

    set
    {
        foreColor = value;
    }
}

protected Color backColor; 
public Color z_BackColorget 
{
    get
    {
    return backColor;
    }

    set
    {
    backColor = value;
    }
}

Good luck, and hope it helps you..