You are on page 1of 56

c  


       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

c 


  



1.? ÷ TRODUCT÷O .2
2.? SOFTWARE REQU÷REME TS..3
3.? SDLC..3
3.1 REQU÷REME T A ALYS÷S...3
3.2 SOFTWARE DES÷ 
3.3 DEVELOPME T PHASE.6
3. TEST÷  PHASE...6
3.5 MA÷ TE A CE PHASE.6
.? DATA FLOW D÷ARAM...7
5.? COD÷ ...10
.1 PARE T FORM.10
.2 F÷ D FORM...37
.3 CH÷LD FORM....39
5. S APSHOTS. 
6. CO CLUS÷O ...5
B÷BL÷ORAPHY

1
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

? c
 
A text editor, in general , is a type of program used to edit plane text files.
Text editors are often provided with operating systems or software
development packages, and can be used to change configuratio n files and
programming language source codes. Various text editors are available in
the market for example, vi editor and Emacs editor in Unix, SimpleText
and TextEdit in Macintosh, notepad in Microsoft windows, and so on. A
text can be graphical user interface based or character user interface based.
A U÷ based application is always preferred over a CU÷ based one since
we have to click with the help of mouse on the icon of readymade
commands instead of typing them.
otepad is the most common text editor used by almost all computer
literate person. ÷t is used to create simple documents. ÷t saves files in plain
text format and support only a few formatting options. ÷t is used to view or
edit text files . users find otepad an ideal tool for creating web pages.
Though notepad is one of the few tools that have been a part of the
windows operating system since the beginning, it has not evolved much
since its initial release.

Some disadvantages , which are known to everyone who frequently uses a


text editor like notepad , are as follows:
O? You cannot open or edit multiple text files at the same time as a text
editor in general does not support multiple document interface.
O? Bulleted text cannot be inserted in text files.
O? otepad support just two black color ±black and white.
O? You cannot take print preview of a document.
O? 0  
 
       
   
To overcome these and other disadvantages , we will try to develop a
better application that will not only be as simple to use a notepad, but also

2
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

offer additional features and enhancements that were left out of the original
otepad.

?
Visual Studio 2008

? c
!"#

Software development life cycle (SDLC) is a methodology used to
develop, maintaining, and replace information systems for improving the quality
and process of software design. The typical phases of SDLC are.
? Requirement analysis
? Software design
? Development
? Testing

 $    % &

÷n this phase we created a list of requirements, which must be filled by the


application. These requirements should be considered while designing the
different modules of the differet projects and are decided acc ording to the
needs of the user. These requirements are as follows:
O? |               
 
  


O? |                        
    
O? |           
    
O? |               

3
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

O? |                   
      
    



!c'!

This project is developed in the following three modules:


O? Ô   
O? Ô
  
O? m     

Ô  

|                  m 
 
   
         |    
     


   

  m Ô
  
                   
     
          
     
  
              
   m |         
   m    !   "  # 
 m    

Ô



c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

| 

  
     
"
  "   
    m   
  

 
 

   m   
 m $

m Ô
Ô
%  #m 
 #|          
O? |   å  &
' # # #  
 
 # $   
O? |   å       "  
            
O? |  å         
        

O? | 
 å      
    

    
O? | 
 å  


    
  (         
O? |    å     
O? |   å         





(()*#(*
This module provides and interface, called Find Box, to help user search a string,
replace a string by another string, or go to a specific line . the interface designed

5
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

in this module is related to many options under the edit menu, which was
designed in the Main Window module


!c+*)!

The development phase involves writing the source code based on the require
functionality adhering the code standards, code optimization etc. ÷t takes its
primary input from the design elements described in the software design phase.
The development of this application involves creating windows forms, class
form.

!'!

After the designing and developing phases, the application is tested for any logical
flows and functionality of all operations. The project is also tested to ensure that all
methods and all modules designed and developed are functioning properly, along with
the navigation links provided in all the user interfaces. Finally, the project is tested to
ensure that all the requirements analysis phase are being fulfilled.

! )*(#!

Finally, the project is implemented in a distributed environment, where it is used by


users logged in from different computer nodes on a network. The application is
maintained thereafter if any requests for changes are forwarded by the use rs.



6
c   
R i l C ll ti R l i
j t i

,* * c c





c     
R i l C ll ti R l i
j t i


















*c c
c 
  


R i l C ll ti R l i
j t i
















c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

+*c c




-
c  
?????????????????
- 

using System;
using System.Collections.eneric;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.÷O;
using System.Drawing.Printing;

namespace otepadPlus
{
public partial class ParentForm : Form
{
ChildForm child = new ChildForm();
StringReader myReader;
Font DocFont;
Color BackgroundColor = new Color();
Color ForegroundColor = new Color();
int m_nFilePointerPosition = 0;

internal int openDoc;


public static int i;
private int childForm umber = 0;

private Brush[] m_brushes = new Brush[] { Brushes.White, Brushes.Black,


Brushes.Blue, Brushes.reen,Brushes.Red, Brushes.Yellow };

10
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

private Color[] m_colors = new Color[] { Color.White, Color.Black, Color.Blue,


Color.reen,Color.Red, Color.Yellow };

private string[] m_colornames = new string[] { "White", "Black", "Blue",


"reen","Red", "Yellow" };

public ParentForm()
{
÷nitializeComponent();
foreach (System.Drawing.FontFamily ff in
System.Drawing.FontFamily.Families)
{
if (ff. ame.Equals("Verdana"))

fontTypeToolStripComboBox.Selected÷ndex =
fontTypeToolStripComboBox.÷tems.Add(ff. ame);
else
fontTypeToolStripComboBox.÷tems.Add(ff. ame);
}

fontSizeToolStripComboBox.Selected÷ndex = 3;

foregroundColorToolStripComboBox.÷tems.AddRange(m_colornames);
backgroundColorToolStripComboBox.÷tems.AddRange(m_colornames);

foregroundColorToolStripComboBox.Selected÷ndex = 1;
backgroundColorToolStripComboBox.Selected÷ndex = 0;
}
public void Find ext(string str)
{
try
{
Form activeChildForm = this.ActiveMdiChild;

if (activeChildForm != null)
{

RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (activeTextBox != null)
{
int nStart = activeTextBox.Text.÷ndexOf(str, m_nFilePointerPosition);
11
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

int nLength = str.Length;

activeTextBox.Select(nStart, nLength);
activeTextBox.Focus();
m_nFilePointerPosition = nStart + nLength;
}
}

}
catch (Exception e)
{
e.ToString();
MessageBox.Show("Reached End of Document.");
m_nFilePointerPosition = 0;
}
}
public void Replace ext(string str, string strReplace)
{
try
{
Form activeChildForm = this.ActiveMdiChild;

if (activeChildForm != null)
{

RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (activeTextBox != null)
{
int nStart = activeTextBox.Text.÷ndexOf(str, 0);
int nLength = str.Length;

activeTextBox.Text = activeTextBox.Text.Remove(nStart, nLength);


activeTextBox.Text = activeTextBox.Text.÷nsert(nStart, strReplace);
activeTextBox.Focus();

}
}
}
catch (Exception e)
{
e.ToString();
12
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

MessageBox.Show("Reached End of Document.");


m_nFilePointerPosition = 0;
}
}

public void ReplaceAll(string str, string strReplace)


{
try
{
Form activeChildForm = this.ActiveMdiChild;

if (activeChildForm != null)
{

RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (activeTextBox != null)
{
int nStart = activeTextBox.Text.÷ndexOf(str, m_nFilePointerPosition);
int nLength = str.Length;

activeTextBox.Select(nStart, nLength);
activeTextBox.Text = activeTextBox.Text.Replace(str, strReplace);
activeTextBox.Focus();
m_nFilePointerPosition = nStart + nLength;

}
}
}
catch (Exception e)
{
e.ToString();
MessageBox.Show("Reached End of Document.");
m_nFilePointerPosition = 0;
}
}

public void oto(int nLine)


{
m_nFilePointerPosition = 0;
for (int i = 1; i <= nLine; i++)
Find ext("\n");
13
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

private void Show ewForm(object sender, EventArgs e)


{
// Create a new instance of the child form.
ChildForm childForm = new ChildForm();
// Make it a child of this MD÷ form before showing it.
childForm umber++;
childForm.MdiParent = this;
childForm.Text = "Untitled " + childForm umber;
childForm.RichTextBox1.Multiline = true;
childForm.RichTextBox1.Dock = DockStyle.Fill;
childForm.Show();
openDoc++;
windowsCountStatusLabel.Text = ("Windows Count: " +
this.MdiChildren.Length);

newToolStripMenu÷tem.Enabled = true;
openToolStripMenu÷tem.Enabled = true;
saveAsToolStripMenu÷tem.Enabled = true;
saveToolStripMenu÷tem.Enabled = true;
SaveAllToolStripMenu÷tem.Enabled = true;
pageSetupToolStripMenu÷tem.Enabled = true;
printPreviewToolStripMenu÷tem.Enabled = true;
printToolStripMenu÷tem.Enabled = true;
exitToolStripMenu÷tem.Enabled = true;
editMenu.Enabled = true;
viewMenu.Enabled = true;
formatMenu.Enabled = true;
windowsMenu.Enabled = true;
standardToolStrip.Enabled = true;
formatToolStrip.Enabled = true;

private void OpenFile(object sender, EventArgs e)


{
string fn;
ChildForm doc = new ChildForm();
StreamReader sr;
OpenFileDialog ofd = new OpenFileDialog();

1
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

ofd.÷nitialDirectory =
Environment.etFolderPath(Environment.SpecialFolder.Personal);
ofd.Title = "Open a Text File";
ofd.Filter = "Text File (*.txt)|*.txt|All Files (*.*)|*.*";

DialogResult dr = ofd.ShowDialog();
fn = ofd.File ame.Trim();
if ((dr == DialogResult.Cancel))
{
return;
}
if (ofd.CheckFileExists)
{
sr = File.OpenText(fn);
doc.RichTextBox1.Text = sr.ReadToEnd();
sr.Close();
doc.MdiParent = this;
doc.Text = ofd.File ame;
doc.RichTextBox1.Multiline = true;
doc.RichTextBox1.Dock = DockStyle.Fill;
doc.Show();
openDoc++;
windowsCountStatusLabel.Text = ("Windows Count: " +
this.MdiChildren.Length);
i = 1;
fileMenu.Enabled = true;

newToolStripMenu÷tem.Enabled = true;
openToolStripMenu÷tem.Enabled = true;
saveAsToolStripMenu÷tem.Enabled = true;
saveToolStripMenu÷tem.Enabled = true;
SaveAllToolStripMenu÷tem.Enabled = true;
pageSetupToolStripMenu÷tem.Enabled = true;
printPreviewToolStripMenu÷tem.Enabled = true;
printToolStripMenu÷tem.Enabled = true;
exitToolStripMenu÷tem.Enabled = true;
editMenu.Enabled = true;
viewMenu.Enabled = true;
formatMenu.Enabled = true;
windowsMenu.Enabled = true;
standardToolStrip.Enabled = true;
15
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

formatToolStrip.Enabled = true;

}
else
{
MessageBox.Show("File not found!");
}

}
private void SaveAsToolStripMenu÷tem_Click(object sender, EventArgs e)
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.÷nitialDirectory =
Environment.etFolderPath(Environment.SpecialFolder.Personal);
sfd.Title = "Save a Text File";
sfd.Filter = "Text File (*.txt)|*.txt|All Files (*.*)|*.*";
if (!(ActiveMdiChild == null))
{
ChildForm doc = (ChildForm)this.ActiveMdiChild;
sfd.File ame = doc.Text;
DialogResult dr = sfd.ShowDialog();
string fn = sfd.File ame.Trim();
if ((dr == DialogResult.Cancel))
{
return;
}
doc.Tag = fn;
doc.Text = fn;
StreamWriter sw = new StreamWriter(fn);
sw.Write(doc.RichTextBox1.Text);
i = 1;
sw.Close();

}
}

private void ExitToolsStripMenu÷tem_Click(object sender, EventArgs e)


{
Application.Exit();
}

private void CutToolStripMenu÷tem_Click(object sender, EventArgs e)


16
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

{
// TODO: Use System.Windows.Forms.Clipboard to insert the selected text or
images into the clipboard
Form activeChildForm = this.ActiveMdiChild;

if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (activeTextBox != null)
activeTextBox.Cut();
}
}

private void CopyToolStripMenu÷tem_Click(object sender, EventArgs e)


{
// TODO: Use System.Windows.Forms.Clipboard to insert the selected text or
images into the clipboard
Form activeChildForm = this.ActiveMdiChild;

if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (activeTextBox != null)
activeTextBox.Copy();
}
}

private void PasteToolStripMenu÷tem_Click(object sender, EventArgs e)


{
// TODO: Use System.Windows.Forms.Clipboard.etText() or
System.Windows.Forms.etData to retrieve information from the clipboard.
Form activeChildForm = this.ActiveMdiChild;

if (activeChildForm != null)
{

RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (activeTextBox != null)
activeTextBox.Paste();
17
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

}
}

private void ToolBarToolStripMenu÷tem_Click(object sender, EventArgs e)


{
standardToolStrip.Visible = toolBarToolStripMenu÷tem.Checked;
}

private void StatusBarToolStripMenu÷tem_Click(object sender, EventArgs e)


{
statusStrip1.Visible = statusBarToolStripMenu÷tem.Checked;
}

private void CascadeToolStripMenu÷tem_Click(object sender, EventArgs e)


{
LayoutMdi(MdiLayout.Cascade);
}

private void TileVerticleToolStripMenu÷tem_Click(object sender, EventArgs e)


{
LayoutMdi(MdiLayout.TileVertical);
}

private void TileHorizontalToolStripMenu÷tem_Click(object sender, EventArgs


e)
{
LayoutMdi(MdiLayout.TileHorizontal);
}

private void CloseAllToolStripMenu÷tem_Click(object sender, EventArgs e)


{
foreach (Form childForm in MdiChildren)
{
childForm.Close();
windowsCountStatusLabel.Text = ("Windows Count: " +
this.MdiChildren.Length);

}
openDoc = 0;
}
18
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

private void ParentForm_Load(object sender, EventArgs e)


{
child.MdiParent = this;
childForm umber++;
child.Text = "Untitled " + childForm umber;
child.RichTextBox1.Multiline = true;
child.RichTextBox1.Dock = DockStyle.Fill;
child.Show();
openDoc++;
timer1.Enabled = true;
windowsCountStatusLabel.Text = ("Windows Count: " +
this.MdiChildren.Length);

private void saveToolStripMenu÷tem_Click(object sender, EventArgs e)


{
if (!(this.ActiveMdiChild == null))
{
ChildForm Doc = (ChildForm)this.ActiveMdiChild;
string fn = Doc.Text.Trim();
if ((fn != ""))
{
if (i == 1)
{
FileStream fs = new
FileStream(fn,
FileMode.Create, FileAccess.Write);
StreamWriter sw = new StreamWriter(fs);
sw.BaseStream.Seek(0, SeekOrigin.Current);
writer(Doc.RichTextBox1.Text.ToString(), sw);
sw.Close();
fs.Close();
}
else
{
SaveAsToolStripMenu÷tem_Click(saveAsToolStripMenu÷tem, new
EventArgs());
}

}
19
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

}
}
public void writer(String str, StreamWriter sw)
{
sw.WriteLine(str);
sw.Flush();

private void SaveAllToolStripMenu÷tem_Click(object sender, EventArgs e)


{
foreach (ChildForm Doc in this.MdiChildren)
{
Doc.Activate();
this.saveToolStripMenu÷tem_Click(this.saveToolStripMenu÷tem, new
EventArgs());
}
}
private void printToolStripMenu÷tem_Click(object sender, EventArgs e)
{
Form activeChildForm = this.ActiveMdiChild;

if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (activeTextBox != null)
{
printDialog1.Document = printDocument1;
string strText = activeTextBox.Text;
myReader = new StringReader(strText);
if (printDialog1.ShowDialog() == DialogResult.OK)
{
this.printDocument1.Print();
}
}
}
}

private void printDocument1_PrintPage(object sender,


System.Drawing.Printing.PrintPageEventArgs e)
20
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

{
Form activeChildForm = this.ActiveMdiChild;
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (activeTextBox != null)
{
float linesPerPage = 0;
float yPosition = 0;
int count = 0;
float leftMargin = e.MarginBounds.Left;
float topMargin = e.MarginBounds.Top;
string line = null;
Font printFont = activeTextBox.Font;
SolidBrush myBrush = new SolidBrush(Color.Black);

// Work out the number of lines per page, using the MarginBounds.
linesPerPage = e.MarginBounds.Height /
printFont.etHeight(e.raphics);
// ÷terate over the string using the StringReader, printing each line.
while (count < linesPerPage && ((line = myReader.ReadLi ne()) != null))
{
// calculate the next line position based on
// the height of the font according to the printing device
yPosition = topMargin + (count * printFont.etHeight(e.raphics));
// draw the next line in the rich edit control
e.raphics.DrawString(line, printFont, myBrush, leftMargin, yPosition,
new StringFormat());
count++;
}
// ÷f there are more lines, print another page.
if (line != null)
e.HasMorePages = true;
else
e.HasMorePages = false;

myBrush.Dispose();
}
}
}

21
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

private void printPreviewToolStripMenu÷tem_Click(object sender, EventArgs e)


{
try
{
Form activeChildForm = this.ActiveMdiChild;
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (activeTextBox != null)
{
string strText = activeTextBox.Text;
myReader = new StringReader(strText);
PrintPreviewDialog printPreviewDialog1 = new PrintPreviewDialog();
printPreviewDialog1.Document = this.printDocument1;
printPreviewDialog1.FormBorderStyle = FormBorderStyle.Fixed3D;
printPreviewDialog1.ShowDialog();
}
}
}
catch (Exception exp)
{
System.Console.WriteLine(exp.Message.ToString());
}
}

private void pageSetupToolStripMenu÷tem_Click(object sender, EventArgs e)


{
PageSettings pgs = new PageSettings();
PageSetupDialog psdg = new PageSetupDialog();
psdg.PageSettings = pgs;
psdg.ShowDialog();
}

private void undoToolStripMenu÷tem_Click(object sender, EventArgs e)


{
if (!(this.ActiveMdiChild == null))
{
ChildForm Doc = (ChildForm)this.ActiveMdiChild;
Doc.RichTextBox1.Undo();
redoToolStripMenu÷tem.Enabled = true;
undoToolStripMenu÷tem.Enabled = false;
22
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

}
}

private void redoToolStripMenu÷tem_Click(object sender, EventArgs e)


{
if (!(this.ActiveMdiChild == null))
{
ChildForm Doc = (ChildForm)this.ActiveMdiChild;
Doc.RichTextBox1.Redo();
redoToolStripMenu÷tem.Enabled = false;
undoToolStripMenu÷tem.Enabled = true;
}
}

private void deleteToolStripMenu÷tem_Click(object sender, EventArgs e)


{
if (!(this.ActiveMdiChild == null))
{
ChildForm Doc = (ChildForm)this.ActiveMdiChild;
if (Doc.RichTextBox1.SelectionLength == 0)
Doc.RichTextBox1.SelectionLength = 1;
Doc.RichTextBox1.SelectedText = "";
}
}

private void selectAllToolStripMenu÷tem_Click(object sender, EventArgs e)


{
if (!(this.ActiveMdiChild == null))
{
ChildForm Doc = (ChildForm)this.ActiveMdiChild;
Doc.RichTextBox1.SelectAll();
}
}

private void DTtoolStripMenu÷tem_Click(object sender, EventArgs e)


{
if (!(this.ActiveMdiChild == null))
{
ChildForm Doc = (ChildForm)this.ActiveMdiChild;
string time = DateTime. ow.ToString();
Doc.RichTextBox1.AppendText(time);
}
23
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

public void CloseToolStripMenu÷tem_Click(object sender, EventArgs e)


{
if (!(this.ActiveMdiChild == null))
{

this.ActiveMdiChild.Close();
openDoc = openDoc - 1;
if (this.ActiveMdiChild == null)
{
openDoc = 0;

}
windowsCountStatusLabel.Text = ("Windows Count: " +
this.MdiChildren.Length);
}

private void aboutToolStripMenu÷tem_Click(object sender, EventArgs e)


{
string appVersion = "3.0";
string str;
str = (" otepadPlus v."+ (appVersion + ("\nThis program is written by" +
("\nRahul Yadav" + ("\nBinary Diagnostics" + "\n10/10/2010")))));
MessageBox.Show(str, " otepadPlus");
}

private void FontToolStripMenu÷tem_Click(object sender, EventArgs e)


{
FontDialog fd = new FontDialog();
DialogResult dr = fd.ShowDialog();
if (dr == DialogResult.Cancel)
return;
ChildForm Doc = (ChildForm)this.ActiveMdiChild;
Doc.RichTextBox1.SelectionFont = fd.Font;
DocFont = fd.Font;
}
2
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

private void bulletedToolStripMenu÷tem_Click(object sender, EventArgs e)


{
try
{
Form activeChildForm = this.ActiveMdiChild;
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
activeTextBox.SelectionBullet = !(activeTextBox.SelectionBullet);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

private void backgroundColorToolStripMenu÷tem_Click(ob ject sender,


EventArgs e)
{
ColorDialog cd = new ColorDialog();
DialogResult dr = cd.ShowDialog();
if (dr == DialogResult.Cancel)
return;
BackgroundColor = cd.Color;

if (!(ActiveMdiChild == null))
{
ChildForm Doc = (ChildForm)this.ActiveMdiChild;
Doc.RichTextBox1.BackColor = BackgroundColor;
}
}

private void foregroundColorToolStripMenu÷tem_Click(object sender, EventArgs


e)
{

ColorDialog cd = new ColorDialog();


DialogResult dr = cd.ShowDialog();
if (dr == DialogResult.Cancel)
25
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

return;
ForegroundColor = cd.Color;
ChildForm Doc = (ChildForm)this.ActiveMdiChild;
Doc.RichTextBox1.SelectionColor = ForegroundColor;
}

private void wordWrapToolStripMenu÷tem_Click(object sender, EventArgs e)


{
if ((this.MdiChildren.Length > 0))
{
if ((wordWrapToolStripMenu÷tem.Checked == true))
{
wordWrapToolStripMenu÷tem.Checked = false;
((ChildForm)(ActiveMdiChild)).RichTextBox1.WordWrap = false;
}
else
{
wordWrapToolStripMenu÷tem.Checked = true;
((ChildForm)(ActiveMdiChild)).RichTextBox1.WordWrap = true;
}
}
}

private void leftToolStripMenu÷tem_Click(object sender, EventArgs e)


{
Form activeChildForm = this.ActiveMdiChild;

if (activeChildForm != null)
{

RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;

activeTextBox.SelectionAlignment = HorizontalAlignment.Left;

}
}

private void centerToolStripMenu÷tem_Click(object sender , EventArgs e)


{
26
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

Form activeChildForm = this.ActiveMdiChild;

if (activeChildForm != null)
{

RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;

activeTextBox.SelectionAlignment = HorizontalAlignment.Center;

}
}

private void rightToolStripMenu÷tem_Click(object sender, EventArgs e)


{
Form activeChildForm = this.ActiveMdiChild;

if (activeChildForm != null)
{

RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;

activeTextBox.SelectionAlignment = HorizontalAlignment.Right;

}
}

private void findToolStripMenu÷tem_Click(object sender, EventArgs e)


{
FindBox tab = new FindBox(this);
tab.Show();
}

private void replaceToolStripMenu÷tem_Click(object sender, EventArgs e)


{
FindBox tab = new FindBox(this);
tab.FindTabControl.SelectedTab = tab.replaceTabPage;
tab.Show();
}

private void gotoToolStripMenu÷tem_Click(object sender, EventArgs e)


27
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

{
FindBox tab = new FindBox(this);
tab.FindTabControl.SelectedTab = tab.gotoTabPage;
tab.Show();
}

private void boldToolStripButton_Click(object sender, EventArgs e)


{
Form activeChildForm = this.ActiveMdiChild;
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (activeTextBox.SelectionFont == null)
{
return;
}
FontStyle style = activeTextBox.SelectionFont.Style;

if (activeTextBox.SelectionFont.Bold)
{
style &= ~FontStyle.Bold;
}
else
{
style |= FontStyle.Bold;
}
activeTextBox.SelectionFont = new Font(activeTextBox.SelectionFont,
style);
}
}

private void italicToolStripButton_Click(object sender, EventArgs e)


{
Form activeChildForm = this.ActiveMdiChild;
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (activeTextBox.SelectionFont == null)
{
return;
28
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

}
FontStyle style = activeTextBox.SelectionFont.Style;
if (activeTextBox.SelectionFont.÷talic)
{
style &= ~FontStyle.÷talic;
}
else
{
style |= FontStyle.÷talic;
}
activeTextBox.SelectionFont = new Font(activeTextBox.SelectionFont,
style);
}
}

private void underlineToolStripButton_Click(object sender, EventArgs e)


{
Form activeChildForm = this.ActiveMdiChild;
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (activeTextBox.SelectionFont == null)
{
return;
}
FontStyle style = activeTextBox.SelectionFont.Style;
if (activeTextBox.SelectionFont.Underline)
{
style &= ~FontStyle.Underline;
}
else
{
style |= FontStyle.Underline;
}
activeTextBox.SelectionFont = new Font(activeTextBox.SelectionFont,
style);
}
}

private void leftAlignToolStripButton_Click(object sender, EventArgs e)


{
29
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

Form activeChildForm = this.ActiveMdiChild;


if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
activeTextBox.SelectionAlignment = HorizontalAlignment.Left;
}
}

private void centerAlignToolStripButton_Click(object sende r, EventArgs e)


{
Form activeChildForm = this.ActiveMdiChild;
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
activeTextBox.SelectionAlignment = HorizontalAlignment.Center;
}
}

private void rightAlignToolStripButton_Click(object sender, EventArgs e)


{
Form activeChildForm = this.ActiveMdiChild;
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
activeTextBox.SelectionAlignment = HorizontalAlignment.Right;
}
}

private void bulletsToolStripButton_Click(object sender, EventArgs e)


{
try
{
Form activeChildForm = this.ActiveMdiChild;
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
activeTextBox.SelectionBullet = !(activeTextBox.SelectionBullet);
}
30
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

private void standardToolStripMenu÷tem_Click(object sender, EventArgs e)


{
if ((standardToolStripMenu÷tem.Checked == true))
{
standardToolStripMenu÷tem.Checked = false;
standardToolStrip.Hide();
}
else
{
standardToolStripMenu÷tem.Checked = true;
standardToolStrip.Show();
}
}

private void formattingToolStripMenu÷tem_Click(object sender, EventArgs e)


{
if ((formattingToolStripMenu÷tem.Checked == true))
{
formattingToolStripMenu÷tem.Checked = false;
formatToolStrip.Hide();
}
else
{
formattingToolStripMenu÷tem.Checked = true;
formatToolStrip.Show();
}
}

private void fontTypeToolStripComboBox_Selected÷ndexChanged(object sender,


EventArgs e)
{
Form activeChildForm = this.ActiveMdiChild;
if (activeChildForm != null)
{

31
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (fontSizeToolStripComboBox.Selected÷ndex == -1 ||
fontTypeToolStripComboBox.Selected÷ndex == -1)
return;

FontStyle style = activeTextBox.SelectionFont. Style;


float size = activeTextBox.SelectionFont.Size;
activeTextBox.SelectionFont = new
Font(fontTypeToolStripComboBox.÷tems[fontTypeToolStripComboBox.Selected÷nde
x].ToString(),size,style);
activeTextBox.Focus();
}
}

private void fontSizeToolStripComboBox_Selected÷ndexChanged(object sender,


EventArgs e)
{
Form activeChildForm = this.ActiveMdiChild;
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (fontSizeToolStripComboBox.Selected÷ndex == -1 ||
fontTypeToolStripComboBox.Selected÷ndex == -1)
return;
FontStyle style = activeTextBox.SelectionFont.Style;
string name = activeTextBox.SelectionFont.FontFamily. ame;

activeTextBox.SelectionFont = new
Font(name,float.Parse(fontSizeToolStripComboBox.÷tems[fontSi zeToolStripComboB
ox.Selected÷ndex].ToString()),style);
activeTextBox.Focus();
}
}

private void foregroundColorToolStripComboBox_Selected÷ndexChanged(object


sender, EventArgs e)
{
Form activeChildForm = this.ActiveMdiChild;
if (activeChildForm != null)
{
32
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
activeTextBox.SelectionColor =
m_colors[foregroundColorToolStripComboBox.Selected÷ndex];
activeTextBox.Focus();
}
}

private void
backgroundColorToolStripComboBox_Selected÷ndexChanged(object sender,
EventArgs e)
{
Form activeChildForm = this.ActiveMdiChild;
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
activeTextBox.BackColor =
m_colors[backgroundColorToolStripComboBox.Selected÷ndex];
activeTextBox.Focus();
}
}

private void timer1_Tick(object sender, EventArgs e)


{
if (openDoc == 0)
{
Program.pf.newToolStripMenu÷tem.Enabled = true;
Program.pf.openToolStripMenu÷tem.Enabled = true;
Program.pf.saveAsToolStripMenu÷tem.Enabled = false;
Program.pf.saveToolStripMenu÷tem.Enabled = false;
Program.pf.SaveAllToolStripMenu÷tem.Enabled = false;
Program.pf.pageSetupToolStripMenu÷tem.Enabled = false;
Program.pf.printPreviewToolStripMenu÷tem.Enabled = false;
Program.pf.printToolStripMenu÷tem.Enabled = false;
Program.pf.exitToolStripMenu÷tem.Enabled = true;
Program.pf.editMenu.Enabled = false;
Program.pf.viewMenu.Enabled = false;
Program.pf.formatMenu.Enabled = false;
Program.pf.windowsMenu.Enabled = false;
Program.pf.standardToolStrip.Enabled = false;
Program.pf.formatToolStrip.Enabled = false;
33
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

}
windowsCountStatusLabel.Text = ("Windows Count: " +
this.MdiChildren.Length);

}
}

 c'#

private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenu÷tem fileMenu;
internal System.Windows.Forms.ToolStripMenu÷tem newToolStripMenu÷tem;
internal System.Windows.Forms.ToolStripMenu÷tem openToolStripMenu÷tem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
internal System.Windows.Forms.ToolStripMenu÷tem saveToolStripMenu÷tem;
internal System.Windows.Forms.ToolStripMenu÷tem saveAsToolStripMenu÷tem;
internal System.Windows.Forms.ToolStripMenu÷tem SaveAllToolStrip
Menu÷tem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator;
internal System.Windows.Forms.ToolStripMenu÷tem printToolStripMenu÷tem;
internal System.Windows.Forms.ToolStripMenu÷tem printPreviewToolStrip
Menu÷tem;
internal System.Windows.Forms.ToolStripMenu÷tem pageSetupToolStrip
Menu÷tem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
internal System.Windows.Forms.ToolStripMenu÷tem exitToolStripMenu÷tem;
internal System.Windows.Forms.ToolStripMenu÷tem editMenu;
private System.Windows.Forms.ToolStripMenu÷tem undoToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem redoToolStripMenu÷tem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
private System.Windows.Forms.ToolStripMenu÷tem cutToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem copyToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem pasteToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem deleteToolStripMenu÷tem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator9;
3
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

private System.Windows.Forms.ToolStripMenu÷tem findToolStripMenu÷tem;


private System.Windows.Forms.ToolStripMenu÷tem
find extToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem replaceToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem gotoToolStripMenu÷tem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
private System.Windows.Forms.ToolStripMenu÷tem DTtoolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem
selectAllToolStripMenu÷tem;
internal System.Windows.Forms.ToolStripMenu÷tem viewMenu;
private System.Windows.Forms.ToolStripMenu÷tem toolBarToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem
standardToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem
formattingToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem
statusBarToolStripMenu÷tem;
internal System.Windows.Forms.ToolStripMenu÷tem formatMenu;
private System.Windows.Forms.ToolStripMenu÷tem FontToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem bulletedToolStripMenu÷tem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
private System.Windows.Forms.ToolStripMenu÷tem
backgroundColorToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem foregroundColorToolStrip
Menu÷tem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator10;
private System.Windows.Forms.ToolStripMenu÷tem wordWrapToolStrip
Menu÷tem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator11;
private System.Windows.Forms.ToolStripMenu÷tem alignmentToolStrip
Menu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem leftToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem centerToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem rightToolStripMenu÷tem;
internal System.Windows.Forms.ToolStripMenu÷tem windowsMenu;
private System.Windows.Forms.ToolStripMenu÷tem newWindowToolStrip
Menu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem cascadeToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem tileVerticalToolStrip
Menu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem tileHorizontalToolStrip
Menu÷tem;
35
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

internal System.Windows.Forms.ToolStripMenu÷tem CloseToolStripMenu÷tem;


private System.Windows.Forms.ToolStripMenu÷tem closeAllToolStrip
Menu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem helpMenu;
private System.Windows.Forms.ToolStripMenu÷tem aboutToolStripMenu÷tem;
private System.Windows.Forms.PrintPreviewDialog printPreviewDialog1;
private System.Drawing.Printing.PrintDocument printDocument1;
private System.Windows.Forms.PrintDialog printDialog1;
internal System.Windows.Forms.ToolStripStatusLabel windowsCount
StatusLabel;
internal System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.Timer timer1;
internal System.Windows.Forms.ToolStrip standardToolStrip;
private System.Windows.Forms.ToolStripButton newToolStripButton;
private System.Windows.Forms.ToolStripButton openToolStripButton;
private System.Windows.Forms.ToolStripButton saveToolStripButton;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripButton printToolStripButton;
private System.Windows.Forms.ToolStripButton printPreviewToolStripButton;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripButton cutToolStripButton;
private System.Windows.Forms.ToolStripButton copyToolStripButton;
private System.Windows.Forms.ToolStripButton pasteToolStripButton;
private System.Windows.Forms.ToolStripButton deleteToolStripButton;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator12;
private System.Windows.Forms.ToolStripButton undoToolStripButton;
private System.Windows.Forms.ToolStripButton redoToolStripButton;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator17;
private System.Windows.Forms.ToolStripButton findToolStripButton;
private System.Windows.Forms.ToolStripButton dtToolStripButton;
internal System.Windows.Forms.ToolStrip formatToolStrip;
privateSystem.Windows.Forms.ToolStripComboBoxfontType
ToolStripComboBox;
privateSystem.Windows.Forms.ToolStripComboBoxfontSizeTool
StripComboBox;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
private System.Windows.Forms.ToolStripButton boldToolStripButton;
private System.Windows.Forms.ToolStripButton italicToolStripButton;
private System.Windows.Forms.ToolStripButton underlineToolStripButton;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripButton leftAlignToolStripButton;
private System.Windows.Forms.ToolStripButton centerAlignToolStripButton;
36
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

private System.Windows.Forms.ToolStripButton rightAlignToolStripButton;


private System.Windows.Forms.ToolStripSeparator toolStripSeparator15;
private System.Windows.Forms.ToolStripButton bulletsToolStripButton;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator16;
privateSystem.Windows.Forms.ToolStripComboBox
backgroundColorToolStripComboBox;
private System.Windows.Forms.ToolStripComboBox
foregroundColorToolStripComboBox;

.? (/0

using System;
using System.Collections.eneric;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace otepadPlus
{
public partial class FindBox : Form
{
private System.Windows.Forms.Form formPad;
public FindBox()
{
÷nitializeComponent();
}
public FindBox(ParentForm pad)
{
formPad = pad;
÷nitializeComponent();
}
private void cancelButton_Click(object sender, EventArgs e)
{
Close();
}

37
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

private void find extButton_Click(object sender, EventArgs e)


{
ParentForm f1 = (ParentForm)(formPad);
f1.Find ext(findWhatTextBox1.Text);
}

private void findWhatTextBox1_TextChanged(object sender, EventArgs e)


{
if (findWhatTextBox1.Text == "")
find extButton.Enabled = false;
else
find extButton.Enabled = true;
}

private void replaceButton_Click(object sender, EventArgs e)


{
ParentForm f2 = (ParentForm)(formPad);
f2.Find ext(findWhatTextBox2.Text);
f2.Replace ext(findWhatTextBox2.Text, replaceWithTextBox.Text);
}

private void replaceAllButton_Click(object sender, EventArgs e)


{
ParentForm f2 = (ParentForm)(formPad);
f2.ReplaceAll(findWhatTextBox2.Text, replaceWithTextBox.Text);
}

private void findWhatTextBox2_TextChanged(object sender, EventArgs e)


{
bool bEnable = (findWhatTextBox2.Text == "") ? false : true;
find extButton2.Enabled = bEnable;
replaceButton.Enabled = bEnable;
replaceAllButton.Enabled = bEnable;
}

private void gotoButton_Click(object sender, EventArgs e)


{
try
{
int nLine = ÷nt32.Parse(gotoTextBox.Text);
ParentForm f2 = (ParentForm)(formPad);
f2.oto(nLine);
38
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

f2.Activate();

}
catch (Exception er)
{
er.ToString();
}
}

private void FindBox_Load(object sender, EventArgs e)


{

}
}

(/0c'#

internal System.Windows.Forms.TabControl FindTabControl;


internal System.Windows.Forms.TabPage findTabPage;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Button find extButton;
private System.Windows.Forms.TextBox findWhatTextBox1;
private System.Windows.Forms.Label findWhatLabel1;
internal System.Windows.Forms.TabPage replaceTabPage;
private System.Windows.Forms.Button cancelButton2;
private System.Windows.Forms.Button replaceAllButton;
private System.Windows.Forms.Button replaceButton;
private System.Windows.Forms.Button find extButton2;
private System.Windows.Forms.TextBox replaceWithTextBox;
private System.Windows.Forms.TextBox findWhatTextBox2;
private System.Windows.Forms.Label replaceWithLabel;
private System.Windows.Forms.Label findWhatLabel2;
internal System.Windows.Forms.TabPage gotoTabPage;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button gotoButton;
private System.Windows.Forms.TextBox gotoTextBox;
private System.Windows.Forms.Label label1;

.3 Child Form

39
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

using System;
using System.Collections.eneric;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.÷O;

namespace otepadPlus
{
public partial class ChildForm : Form
{
public ChildForm()
{
÷nitializeComponent();
}
private void undoToolStripMenu÷tem_Click(object sender, EventArgs e)
{
RichTextBox1.Undo();
}

private void cutToolStripMenu÷tem_Click(object sender, EventArgs e)


{
RichTextBox1.Cut();
}

private void copyToolStripMenu÷tem_Click(object sender, EventArgs e)


{
RichTextBox1.Copy();
}

private void pasteToolStripMenu÷tem_Click(object sender, EventArgs e)


{
RichTextBox1.Paste();
}

private void deleteToolStripMenu÷tem_Click(object sender, EventArgs e)


{
if (RichTextBox1.SelectionLength == 0)
RichTextBox1.SelectionLength = 1;
0
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

RichTextBox1.SelectedText = "";
}

private void selectAllToolStripMenu÷tem_Click(object sender, EventArgs e)


{
RichTextBox1.SelectAll();
}

private void fontToolStripMenu÷tem_Click(object sender, EventArgs e)


{
FontDialog fd = new FontDialog();
DialogResult dr;
dr = fd.ShowDialog();
if (dr == DialogResult.Cancel)
return;
try
{
RichTextBox1.Font = fd.Font;
Font DocFont = fd.Font;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

private void bulletsToolStripMenu÷tem_Click(object sender, EventArgs e)


{
try
{
RichTextBox1.SelectionBullet = !(RichTextBox1.SelectionBullet);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

private void ChildForm_FormClosing(object sender, FormClosingEventArgs e)


{

if (RichTextBox1.Text != "")
1
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

DialogResult reply = MessageBox.Show("Do you want to save changes ?",


"Save File", MessageBoxButtons.Yes oCancel,
MessageBox÷con.Warning);
if (reply == DialogResult.Yes)
{

SaveFileDialog sfd = new SaveFileDialog();


sfd.Title = "Save a Text File";
sfd.Filter = "Text File (*.txt)|*.txt|All Files (*.*)|*.*";
string fn;
StreamWriter sw;
DialogResult dr;
sfd.File ame = this.Text;
dr = sfd.ShowDialog();
fn = sfd.File ame.Trim();
if ((dr == DialogResult.Cancel))
{
e.Cancel = true;
}
this.Tag = fn;
this.Text = fn;
sw = new StreamWriter(fn);
sw.Write(RichTextBox1.Text);
sw.Close();
Program.pf.openDoc = Program.pf.openDoc - 1;
}
if (reply == DialogResult. o)
{
Program.pf.openDoc = Program.pf.openDoc - 1;
}
if (reply == DialogResult.Cancel)
{
e.Cancel = true;
}
}
else
{
Program.pf.openDoc = Program.pf.openDoc - 1;
}
2
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

private void ChildForm_Load(object sender, EventArgs e)


{

}
}
}

!*( c'#

private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenu÷tem undoToolStripMenu÷tem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenu÷tem cutToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem copyToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem pasteToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem deleteToolStripMenu÷tem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenu÷tem selectAllToolStrip
Menu÷tem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripMenu÷tem fontToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem bulletsToolStripMenu÷ tem;
internal System.Windows.Forms.RichTextBox RichTextBox1; 












3
c 
  


R i l C ll ti R l i
j t i






?r r r









44
c 
  


R i l C ll ti R l i
j t i














4
c 
  


R i l C ll ti R l i
j t i










4
c 
  


R i l C ll ti R l i
j t i








4
c 
  


R i l C ll ti R l i
j t i














4
c 
  


R i l C ll ti R l i
j t i








4
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011








50
c 
  


R i l C ll ti R l i
j t i








c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011










52
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011











53
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011


1?

 

OTEAD PLUS it is a Software which makes our task easy to use so that we can
easily handle it and understand it. Software provided by windows are bounded for
many applications, so we need a software which has no boundations for using and easy
to handle it.
otepad plus provides many additional fe atures such as online print, changing
background color, changing text color, changing fonts and etc
÷n this software we can select and replace many character for this we are provided a
find and replace box. This software can be updated by adding many features and its
source code is available freely on the internet.
This software is very light and has just two dependency child and find. The tool bar
provided is easy to understand and easy to handle. And the tool bar is user friendly.

5
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

"#2+3)

 2+ 4
  
 
 
 
 
 
  
  
  
  
  
  
  
  
  
  
  

&"#**2(5(#)#2+6 (67c
2+#2#)*6c#6c
55
c   
       
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011

/ /  7%

° ?  j
j
?
?   
   j
?
?   
  

?
 ?   ?
 ?      
     j j ?
 ? å 
  
 &  )*+)*+ ?
º ?   
   jjj 
j?
?

56