1. SUBMITED BY
Deepika Mittal
Bachelor of Computer Application IIl YEAR
Dezyne École College
www.dezyneecole.com
INFORMATION TECHNOLOGY
PROJECT REPORT
Visual Basic PROGRAMMING
Notepad
TOPIC
Visual Basic
2. Project Report
On
Visual Basic
At
Dezyne Ećole College
Ajmer
Submitted to
Dezyne Ećole College
Towards the
Partial Fulfillment on
Bachelors of Computer Application
By
Deepika Mittal
Dezyne E’cole College
106/10 Civil Line, Ajmer
Tel – 0145-2624679
Www.dezyneecole.com
2016
3. Acknowledgement
I Deepika Mittal, Student On Dezyne Ećole College, An Extremely
Grateful To Each And Every Individual. Who Has Contributed. In
Successful Completion Of My Project. I Express My Gratitude Towards
Dezyne Ećole College For Their. Guidance and Contrast Supervision As
Well As For Providing The Necessary Information And Support Regarding
The Completion Of Project
Thank You
4. Synopsis
This Project Is A Minor. Project Made, Based On The Practical
Concept Of Visual Basic This Project Has Made Our Basic Practical
Concepts On Visual Basic Strong.
27. Source
Dim i As Integer
Dim fin, s As Variant
Dim m%
Option Explicit
Const maxUndo = 150
Dim gblnIgnoreChange As Boolean
Dim gintIndex As Integer
Dim gstrStack(maxUndo) As String
Dim stackBK(maxUndo) As String
Private Sub Form_Activate()
Form1.Caption = "Untitled-Notepad"
m = 1
RichTextBox1.RightMargin = Screen.Width - (Screen.Width -
RichTextBox1.Width - 0)
End Sub
Private Sub mnuprint_Click()
CommonDialog1.Flags = 1
CommonDialog1.ShowPrinter
End Sub
Private Sub mnucopy_Click()
Clipboard.SetText RichTextBox1.SelText
End Sub
Private Sub mnucut_Click()
Clipboard.SetText RichTextBox1.SelText
RichTextBox1.SelText = " "
End SubSub
Private Sub mnudelete_Click()
RichTextBox1.Text = " "
End Sub
Private Sub mnuexit_Click()
If i <> 1 Then
s = MsgBox("Do you Want to Save Your File.", vbYesNoCancel)
If s = 6 Then
CommonDialog1.InitDir = "G:"
28. CommonDialog1.Filter = "TEXT | *.txt"
CommonDialog1.ShowSave
RichTextBox1.SaveFile CommonDialog1.FileName
Unload Me
i = i + 10
ElseIf s = 7 Then
Unload Me
i = i + 10
End If
i = 0
Else
i = 0
Unload Me
End If
End Sub
Private Sub mnufind_Click()
fin = InputBox("Enter Word", "Find")
RichTextBox1.Find (fin)
End Sub
Private Sub mnufont_Click()
CommonDialog1.Flags = 1
CommonDialog1.ShowFont
RichTextBox1.SelFontName = CommonDialog1.FontName
RichTextBox1.SelBold = CommonDialog1.FontBold
RichTextBox1.SelItalic = CommonDialog1.FontItalic
RichTextBox1.SelUnderline = CommonDialog1.FontUnderline
RichTextBox1.SelStrikeThru = CommonDialog1.FontStrikethru
RichTextBox1.SelFontSize = CommonDialog1.FontSize
End Sub
Private Sub mnunew_Click()
If i <> 0 Then
s = MsgBox("Do you Want to Save Your File.", vbYesNoCancel)
If s = 6 Then
RichTextBox1.Text = " "
CommonDialog1.InitDir = "G:"
CommonDialog1.Filter = "TEXT | *.txt"
CommonDialog1.ShowSave
RichTextBox1.SaveFile CommonDialog1.FileName
i = i - 1
ElseIf s = 7 Then
29. Form1.RichTextBox1.Text = " "
CommonDialog1.InitDir = "G:"
CommonDialog1.Filter = "TEXT | *.txt"
i = i - 1
End If
Else
Form1.RichTextBox1.Text = " "
i = i + 1
End If
End Sub
Private Sub mnuopen_Click()
If i <> 0 Then
s = MsgBox("Do you Want to Change Your File.", vbYesNoCancel)
If s = 6 Then
RichTextBox1.Text = " "
CommonDialog1.InitDir = "G:"
CommonDialog1.Filter = "TEXT | *.txt"
CommonDialog1.ShowOpen
RichTextBox1.LoadFile (CommonDialog1.FileName)
i = i + 1
End If
Else
CommonDialog1.InitDir = "G:"
CommonDialog1.Filter = "TEXT | *.txt"
CommonDialog1.ShowOpen
RichTextBox1.LoadFile (CommonDialog1.FileName)
i = i + 1
End If
End Sub
Private Sub mnupaste_Click()
RichTextBox1.SelText = Clipboard.GetText
End Sub
Private Sub mnuprint_Click()
CommonDialog1.Flags = 1
CommonDialog1.ShowPrinter
End Sub
Private Sub mnure_Click()
Form2.Show
End Sub
30. Private Sub mnusave_Click()
If i <> 1 Then
s = MsgBox("Do you Want to Save Your File.", vbYesNoCancel)
If s = 6 Then
CommonDialog1.InitDir = "G:"
CommonDialog1.Filter = "TEXT | *.txt"
CommonDialog1.ShowSave
RichTextBox1.SaveFile (CommonDialog1.FileName)
i = 1
End If
ElseIf i = 1 Then
RichTextBox1.SaveFile (CommonDialog1.FileName)
End If
End Sub
Private Sub mnusaveas_Click()
If i <> 0 Then
s = MsgBox("Do you Want to Save Your File.", vbYesNoCancel)
If s = 6 Then
CommonDialog1.Filter = "TEXT | *.txt"
CommonDialog1.ShowSave
RichTextBox1.SaveFile (CommonDialog1.FileName)
i = i + 1
End If
Else
CommonDialog1.Filter = "TEXT | *.txt"
CommonDialog1.ShowSave
RichTextBox1.SaveFile (CommonDialog1.FileName)
i = i + 1
End If
End Sub
Private Sub mnuseal_Click()
Call msel
End Sub
Public Sub msel()
RichTextBox1.SelStart = 0
RichTextBox1.SelLength = Len(RichTextBox1.Text)
End Sub
Private Sub mnustatus_Click()
If mnustatus.Checked = True Then
mnustatus.Checked = False
31. Private Sub mnustatus_Click()
If mnustatus.Checked = True Then
mnustatus.Checked = False
StatusBar1.Visible = False
RichTextBox1.Height = Form1.Height - 850
Else
mnustatus.Checked = False
mnustatus.Checked = True
StatusBar1.Visible = True
RichTextBox1.Height = RichTextBox1.Height - 375
End If
End Sub
Private Sub mnutd_Click()
RichTextBox1.Text = Now()
End Sub
Private Sub mnuUndo_Click()
Call undo
End Sub
Private Sub mnuviewhelp_Click()
CommonDialog1.Flags = 1
CommonDialog1.ShowHelp
End Sub
Public Sub undo()
If gintIndex = 0 Then Exit Sub
gblnIgnoreChange = True
gintIndex = gintIndex - 1
On Error Resume Next
RichTextBox1.TextRTF = gstrStack(gintIndex)
gblnIgnoreChange = False
End Sub
Private Sub mnuword_Click()
If mnuword.Checked = True Then
mnuword.Checked = False
RichTextBox1.RightMargin = Screen.Width - (Screen.Width - RichTextBox1.Width
- 10000000)
Else
mnuword.Checked = True
RichTextBox1.RightMargin = Screen.Width - (Screen.Width - RichTextBox1.Width
- 1)
32. End If
End Sub
Private Sub RichTextBox1_Change()
Dim g As Integer
Dim b As Integer
Dim i As Integer
g = maxUndo
If Not gblnIgnoreChange Then
gintIndex = gintIndex + 1
If gintIndex >= maxUndo + 1 Then
For b = 0 To maxUndo
stackBK(b) = gstrStack(b)
Next b
For i = 0 To maxUndo
If g >= 1 Then
g = g - 1
gstrStack(g) = stackBK(g + 1)
End If
Next i
gintIndex = maxUndo
End If
gstrStack(gintIndex) = RichTextBox1.TextRTF
End If
End Sub
Private Sub mnuedit_click()
If RichTextBox1.SelLength = 0 Then
mnucut.Enabled = False
mnucopy.Enabled = False
mnudelete.Enabled = True
mnuseal.Enabled = True
ElseIf RichTextBox1.SelLength = Len(RichTextBox1.Text) Then
mnucut.Enabled = True
mnucopy.Enabled = True
mnudelete.Enabled = False
mnuseal.Enabled = False
Else
mnucut.Enabled = True
33. mnucopy.Enabled = True
mnudelete.Enabled = False
mnuseal.Enabled = True
End If
If Len(Clipboard.GetText(1)) = 0 Then
mnupaste.Enabled = False
Else
mnupaste.Enabled = True
End If
End Sub