SlideShare a Scribd company logo
1 of 25
Download to read offline
Visual Basic Assessment
A WORK REPORT SUBMITTED
IN PARTIAL FULLFILLMENT OF THE REQUIREMENT FOR THE DEGREE
Bachelors of Computer Application
Dezyne E’cole College
106/10, CIVIL LINES
AJMER
RAJASTHAN - 305001 (INDIA)
www.dezyneecole.com
TOPIC: Notepad
SUBMITTED BY:
POOJA SHARMA
BCA 3rd YEAR
Acknowledgement
I Pooja Sharma student of Dezyne E’cole College, extremely grateful to each and
every individual who has contributed in successful completion of my project.
I express my gratitude towards Dezyne E’cole College to their guidelines and
constant supervision as well as for providing the necessary information and
support regarding the completion of project.
Thanks.
Synopsis
This project is a minor project made based on practical concepts of Visual Basic.
This project has made our basic practical concepts strong.
OUTPUT:
CODING:
Form1:
Dim rp, fp, a As Variant
Dim m%, b%, c%, fd%, d%
Option Explicit
Const maxUndo = 50
Dim gblnIgnoreChange As Boolean
Dim gintIndex As Integer
Dim gstrStack(maxUndo) As String
Dim stackBK(maxUndo) As String
Dim i As Integer
Private Sub copy_Click()
Call mcop
End Sub
Public Sub mcop()
Clipboard.SetText RichTextBox1.SelText
End Sub
Private Sub cut_Click()
Call mcut
End Sub
Private Sub edit_Click()
If RichTextBox1.SelLength = 0 Then
cut.Enabled = False
copy.Enabled = False
delete.Enabled = False
selectall.Enabled = True
ElseIf RichTextBox1.SelLength = Len(RichTextBox1.Text) Then
cut.Enabled = True
copy.Enabled = True
delete.Enabled = True
selectall.Enabled = False
Else
cut.Enabled = True
copy.Enabled = True
delete.Enabled = True
selectall.Enabled = True
End If
If Len(Clipboard.GetText(1)) = 0 Then
paste.Enabled = False
Else
paste.Enabled = True
End If
End Sub
Private Sub munpop_click()
If RichTextBox1.SelLength = 0 Then
munc.Enabled = False
muncop.Enabled = False
mundele.Enabled = False
munsele.Enabled = True
ElseIf RichTextBox1.SelLength = Len(RichTextBox1.Text) Then
munc.Enabled = True
muncop.Enabled = True
mundele.Enabled = True
munsele.Enabled = False
Else
munc.Enabled = True
muncop.Enabled = True
mundele.Enabled = True
munsele.Enabled = True
End If
If Len(Clipboard.GetText(1)) = 0 Then
munpst.Enabled = False
Else
munpst.Enabled = True
End If
End Sub
Public Sub mcut()
Clipboard.SetText RichTextBox1.SelText
RichTextBox1.SelText = " "
End Sub
Private Sub delete_Click()
Call mdel
End Sub
Public Sub mdel()
RichTextBox1.SelText = ""
RichTextBox1.SelText = ""
End Sub
Private Sub exit_Click()
Unload Me
End Sub
Private Sub munc_Click()
Call mcut
End Sub
Private Sub muncop_Click()
Call mcop
End Sub
Private Sub mundele_Click()
Call mdel
End Sub
Private Sub munfind_Click()
fd = InputBox("Enter Word", "Find")
RichTextBox1.Find (fd)
End Sub
Private Sub munfindnext_Click()
Form4.Show
End Sub
Private Sub Form_Load()
Form1.Caption = "Untitled-Notepad"
m = 1
RichTextBox1.RightMargin = Screen.Width - (Screen.Width - RichTextBox1.Width - 6000)
End Sub
Private Sub Form_Resize()
RichTextBox1.Width = Form1.Width - 300
RichTextBox1.Height = Form1.Height - 1140
End Sub
Private Sub helptopics_Click()
On Error Resume Next
With CommonDialog1
.Flags = 1
.CancelError = True
.ShowHelp
End With
End Sub
Private Sub munfont_Click()
On Error Resume Next
With CommonDialog1
.Flags = 1
.CancelError = True
.ShowFont
End With
RichTextBox1.Font.Name = CommonDialog1.FontName
RichTextBox1.Font.Size = CommonDialog1.FontSize
RichTextBox1.Font.Bold = CommonDialog1.FontBold
RichTextBox1.Font.Italic = CommonDialog1.FontItalic
RichTextBox1.Font.Underline = CommonDialog1.FontUnderline
RichTextBox1.Font.Strikethrough = CommonDialog1.FontStrikethru
End Sub
Private Sub munpst_Click()
Call mpas
End Sub
Private Sub munsave_Click()
On Error GoTo Label
Dim ifile As Integer
Dim savefile As Boolean
Dim txtbox As Object
Dim filepath As String
Dim append As Boolean
With CommonDialog1
.Flags = 1
.CancelError = True
.Filter = "Text Document(*.txt)|*.txt |All Files(*.*)|*.*"
If m = 1 Then
m = m + 1
.ShowSave
End If
End With
ifile = FreeFile
If append Then
Open CommonDialog1.FileName For Append As #ifile
Else
Open CommonDialog1.FileName For Output As #ifile
End If
Print #ifile, RichTextBox1.Text
savefile = True
Label:
Close #ifile
Form1.Caption = CommonDialog1.FileTitle + "-Notepad"
End Sub
Private Sub munsele_Click()
Call msel
End Sub
Private Sub munund_Click()
Call und
End Sub
Public Sub und()
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 new_Click()
On Error Resume Next
m = 1
If RichTextBox1.Text <> "" Then
a = MsgBox("Do you want to save the changes?", vbYesNoCancel + vbQuestion, "Save")
If a = vbYes Then
With CommonDialog1
.CancelError = True
.InitDir = "E:"
.Filter = "Text Documents(*.txt)|*.txt | All Files(*.*)|*.*"
.ShowSave
End With
RichTextBox1.Text = ""
End If
If a = vbNo Then
RichTextBox1.Text = " "
End If
End If
End Sub
Private Sub notepad_Click()
Form2.Show
End Sub
Private Sub open_Click()
On Error Resume Next
With CommonDialog1
.CancelError = True
.InitDir = "E:"
.Filter = "Text Documents(*.txt)|*.txt| All Files(*.*) | *.*"
.ShowOpen
End With
RichTextBox1.LoadFile (CommonDialog1.FileName)
End Sub
Private Sub paste_Click()
Call mpas
End Sub
Public Sub mpas()
If Clipboard.GetFormat(vbCFText) Then
RichTextBox1.SelText = Clipboard.GetText(vbCFText)
End If
End Sub
Private Sub print_Click()
On Error GoTo Label
Dim b, e, n, i As Variant
With CommonDialog1
.Flags = 1
.CancelError = True
.ShowPrinter
b = .FromPage
e = .ToPage
n = .Copies
End With
For i = 1 To n
Printer.Print RichTextBox1.Text
Next
Exit Sub
Label:
Exit Sub
End Sub
Private Sub replace_Click()
Form3.Show
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 saveas_Click()
On Error GoTo Label
Dim ifile As Integer
Dim savefile As Boolean
Dim txtbox As Object
Dim filepath As String
Dim append As Boolean
With CommonDialog1
.Flags = 1
.CancelError = True
.Filter = "Text Document(*.txt)|*.txt |All Files(*.*)|*.*"
.ShowSave
End With
ifile = FreeFile
If append Then
Open CommonDialog1.FileName For Append As #ifile
Else
Open CommonDialog1.FileName For Output As #ifile
End If
Print #ifile, RichTextBox1.Text
savefile = True
Label:
Close #ifile
Form1.Caption = CommonDialog1.FileTitle + "-Notepad"
End Sub
Private Sub selectall_Click()
Call msel
End Sub
Public Sub msel()
RichTextBox1.SelStart = 0
RichTextBox1.SelLength = Len(RichTextBox1.Text)
End Sub
Private Sub statusbar_Click()
If statusbar.Checked = True Then
statusbar.Checked = False
StatusBar1.Visible = False
RichTextBox1.Height = Form1.Height - 850
Else
statusbar.Checked = False
statusbar.Checked = True
StatusBar1.Visible = True
RichTextBox1.Height = RichTextBox1.Height - 375
End If
End Sub
Private Sub timedate_Click()
RichTextBox1.SelText = Now()
End Sub
Private Sub undo_Click()
Call und
End Sub
Private Sub VScroll1_Change()
RichTextBox1.RightMargin = 0
RichTextBox1.Left = 0
End Sub
Private Sub wordwrap_Click()
If wordwrap.Checked = True Then
wordwrap.Checked = False
RichTextBox1.RightMargin = Screen.Width - (Screen.Width - RichTextBox1.Width - 1000000)
Else
wordwrap.Checked = True
RichTextBox1.RightMargin = Screen.Width - (Screen.Width - RichTextBox1.Width - 6000)
End If
End Sub
Form2:
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Load()
Form2.Caption = "About As"
End Sub
Form3:
Option Explicit
Dim lastpos As Integer
Dim findtext As String
Private Sub Command1_Click()
findtext = Text1.Text
If Check1.Value = vbChecked Then
lastpos = InStr(lastpos + 1, Form1.RichTextBox1.Text, findtext, vbBinaryCompare)
Else
lastpos = InStr(lastpos + 1, Form1.RichTextBox1.Text, findtext, vbTextCompare)
End If
If lastpos > 0 Then
Form1.RichTextBox1.SelStart = lastpos - 1
Form1.RichTextBox1.SelLength = Len(findtext)
Else
MsgBox "Not Found"
End If
End Sub
Private Sub Command2_Click()
Dim fp, a, rp As String
fp = Text1.Text
rp = Text2.Text
a = Form1.RichTextBox1.Find(fp)
If a <> -1 Then
a = Form1.RichTextBox1.Find(fp)
Form1.RichTextBox1.SelText = rp
Else
MsgBox "Not Found"
End If
End Sub
Private Sub Command3_Click()
findtext = Text1.Text
lastpos = 0
If Check1.Value = vbChecked Then
lastpos = InStr(lastpos + 1, Form1.RichTextBox1.Text, findtext, vbBinaryCompare)
Else
lastpos = InStr(lastpos + 1, Form1.RichTextBox1.Text, findtext, vbTextCompare)
End If
If lastpos > 0 Then
Do While lastpos > 0
Form1.RichTextBox1.SelStart = lastpos - 1
Form1.RichTextBox1.SelLength = Len(findtext)
Form1.RichTextBox1.SelText = Text2.Text
If Check1.Value = vbChecked Then
lastpos = InStr(lastpos + 1, Form1.RichTextBox1.Text, findtext, vbBinaryCompare)
Else
lastpos = InStr(lastpos + 1, Form1.RichTextBox1.Text, findtext, vbTextCompare)
End If
If lastpos = 0 Then
MsgBox "All Instances have been replaced"
Exit Do
End If
Loop
Else
MsgBox "Not Found"
End If
Form1.RichTextBox1.SelStart = 0
Form1.RichTextBox1.SelLength = 0
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Form_Load()
Form3.Caption = "Replace"
End Sub
Private Sub Text1_Change()
If Text1 = "" Then
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Else
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
End If
End Sub
Form4:
Option Explicit
Dim lastpos As Integer
Dim findtext As String
Private Sub Command1_Click()
findtext = Text1.Text
If Check1.Value = vbChecked Then
lastpos = InStr(lastpos + 1, Form1.RichTextBox1.Text, findtext, vbBinaryCompare)
Else
lastpos = InStr(lastpos + 1, Form1.RichTextBox1.Text, findtext, vbTextCompare)
End If
If lastpos > 0 Then
Form1.RichTextBox1.SelStart = lastpos - 1
Form1.RichTextBox1.SelLength = Len(findtext)
Else
MsgBox "Not Found"
End If
Form3.Text1.Text = Text1.Text
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Form4.Caption = "Find"
End Sub
THANK YOU
Submitted By:
Pooja Sharma
BCA 3rd Year
Dezyne E’cole College

More Related Content

What's hot

Reshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third YearReshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third Yeardezyneecole
 
Kirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third YearKirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third Yeardezyneecole
 
Bhanu Pratap Singh Shekhawat, BCA Third Year
Bhanu Pratap Singh Shekhawat, BCA Third YearBhanu Pratap Singh Shekhawat, BCA Third Year
Bhanu Pratap Singh Shekhawat, BCA Third YearDezyneecole
 
Reservasi hotel
Reservasi hotelReservasi hotel
Reservasi hoteldian pw
 
Sachin Foujdar , BCA Third Year
Sachin Foujdar , BCA Third YearSachin Foujdar , BCA Third Year
Sachin Foujdar , BCA Third YearDezyneecole
 
[FT-7][snowmantw] How to make a new functional language and make the world be...
[FT-7][snowmantw] How to make a new functional language and make the world be...[FT-7][snowmantw] How to make a new functional language and make the world be...
[FT-7][snowmantw] How to make a new functional language and make the world be...Functional Thursday
 
Google Go For Ruby Hackers
Google Go For Ruby HackersGoogle Go For Ruby Hackers
Google Go For Ruby HackersEleanor McHugh
 
Inventory management
Inventory managementInventory management
Inventory managementRajeev Sharan
 
Deepika Mittal , BCA Third Year
Deepika Mittal , BCA Third YearDeepika Mittal , BCA Third Year
Deepika Mittal , BCA Third Yeardezyneecole
 
Java JOptionPane tutorial - Message, input, and confirm dialogs
Java JOptionPane tutorial - Message, input, and confirm dialogsJava JOptionPane tutorial - Message, input, and confirm dialogs
Java JOptionPane tutorial - Message, input, and confirm dialogsAbeer Megahed
 
Kotlin on Android: Delegate with pleasure
Kotlin on Android: Delegate with pleasureKotlin on Android: Delegate with pleasure
Kotlin on Android: Delegate with pleasureDmytro Zaitsev
 

What's hot (17)

Reshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third YearReshma Kodwani , BCA Third Year
Reshma Kodwani , BCA Third Year
 
Kirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third YearKirti Kumawat, BCA Third Year
Kirti Kumawat, BCA Third Year
 
Bhanu Pratap Singh Shekhawat, BCA Third Year
Bhanu Pratap Singh Shekhawat, BCA Third YearBhanu Pratap Singh Shekhawat, BCA Third Year
Bhanu Pratap Singh Shekhawat, BCA Third Year
 
Vb file
Vb fileVb file
Vb file
 
Reservasi hotel
Reservasi hotelReservasi hotel
Reservasi hotel
 
Sachin Foujdar , BCA Third Year
Sachin Foujdar , BCA Third YearSachin Foujdar , BCA Third Year
Sachin Foujdar , BCA Third Year
 
[FT-7][snowmantw] How to make a new functional language and make the world be...
[FT-7][snowmantw] How to make a new functional language and make the world be...[FT-7][snowmantw] How to make a new functional language and make the world be...
[FT-7][snowmantw] How to make a new functional language and make the world be...
 
Go &lt;-> Ruby
Go &lt;-> RubyGo &lt;-> Ruby
Go &lt;-> Ruby
 
Eugene goostman the bot
Eugene goostman the botEugene goostman the bot
Eugene goostman the bot
 
Google Go For Ruby Hackers
Google Go For Ruby HackersGoogle Go For Ruby Hackers
Google Go For Ruby Hackers
 
VB 6
VB 6VB 6
VB 6
 
Inventory management
Inventory managementInventory management
Inventory management
 
Deepika Mittal , BCA Third Year
Deepika Mittal , BCA Third YearDeepika Mittal , BCA Third Year
Deepika Mittal , BCA Third Year
 
Calculator code
Calculator codeCalculator code
Calculator code
 
Java JOptionPane tutorial - Message, input, and confirm dialogs
Java JOptionPane tutorial - Message, input, and confirm dialogsJava JOptionPane tutorial - Message, input, and confirm dialogs
Java JOptionPane tutorial - Message, input, and confirm dialogs
 
Kotlin on Android: Delegate with pleasure
Kotlin on Android: Delegate with pleasureKotlin on Android: Delegate with pleasure
Kotlin on Android: Delegate with pleasure
 
CRUD VB2010
CRUD VB2010CRUD VB2010
CRUD VB2010
 

Similar to VB Assessment Project for Notepad Application

FUNCTIONS IN PYTHON, CLASS 12 COMPUTER SCIENCE
FUNCTIONS IN PYTHON, CLASS 12 COMPUTER SCIENCEFUNCTIONS IN PYTHON, CLASS 12 COMPUTER SCIENCE
FUNCTIONS IN PYTHON, CLASS 12 COMPUTER SCIENCEVenugopalavarma Raja
 
Membuat aplikasi penjualan buku sederhana
Membuat aplikasi penjualan buku sederhanaMembuat aplikasi penjualan buku sederhana
Membuat aplikasi penjualan buku sederhanaYusman Kurniadi
 
Código Editor Net
Código Editor NetCódigo Editor Net
Código Editor Netcymbron
 
19.Advanced Visual Basic Lab.pdf
19.Advanced Visual Basic Lab.pdf19.Advanced Visual Basic Lab.pdf
19.Advanced Visual Basic Lab.pdfvirox10x
 
LoginFormCode
LoginFormCodeLoginFormCode
LoginFormCoderk5media
 
Makalah Pemrograman Visual “Aplikasi Travel”
Makalah Pemrograman Visual “Aplikasi Travel”Makalah Pemrograman Visual “Aplikasi Travel”
Makalah Pemrograman Visual “Aplikasi Travel”SMK MUhammadiyah Singkut
 
Uniface Lectures Webinar - Uniface 10 Technical Deep Dive
Uniface Lectures Webinar - Uniface 10 Technical Deep DiveUniface Lectures Webinar - Uniface 10 Technical Deep Dive
Uniface Lectures Webinar - Uniface 10 Technical Deep DiveUniface
 
โครงการ 5 บท
โครงการ 5 บทโครงการ 5 บท
โครงการ 5 บทMareenaHahngeh
 
โครงการ 5 บท
โครงการ 5 บทโครงการ 5 บท
โครงการ 5 บทMareenaHahngeh
 
Practicalfileofvb workshop
Practicalfileofvb workshopPracticalfileofvb workshop
Practicalfileofvb workshopdhi her
 
Vbreport program
Vbreport programVbreport program
Vbreport programdhi her
 

Similar to VB Assessment Project for Notepad Application (20)

VB net lab.pdf
VB net lab.pdfVB net lab.pdf
VB net lab.pdf
 
FUNCTIONS IN PYTHON, CLASS 12 COMPUTER SCIENCE
FUNCTIONS IN PYTHON, CLASS 12 COMPUTER SCIENCEFUNCTIONS IN PYTHON, CLASS 12 COMPUTER SCIENCE
FUNCTIONS IN PYTHON, CLASS 12 COMPUTER SCIENCE
 
Membuat aplikasi penjualan buku sederhana
Membuat aplikasi penjualan buku sederhanaMembuat aplikasi penjualan buku sederhana
Membuat aplikasi penjualan buku sederhana
 
Vbreport
VbreportVbreport
Vbreport
 
.net progrmming part4
.net progrmming part4.net progrmming part4
.net progrmming part4
 
Docimp
DocimpDocimp
Docimp
 
Richtextbox
RichtextboxRichtextbox
Richtextbox
 
Código Editor Net
Código Editor NetCódigo Editor Net
Código Editor Net
 
Ict project pdf
Ict project pdfIct project pdf
Ict project pdf
 
19.Advanced Visual Basic Lab.pdf
19.Advanced Visual Basic Lab.pdf19.Advanced Visual Basic Lab.pdf
19.Advanced Visual Basic Lab.pdf
 
LoginFormCode
LoginFormCodeLoginFormCode
LoginFormCode
 
Makalah Pemrograman Visual “Aplikasi Travel”
Makalah Pemrograman Visual “Aplikasi Travel”Makalah Pemrograman Visual “Aplikasi Travel”
Makalah Pemrograman Visual “Aplikasi Travel”
 
Uniface Lectures Webinar - Uniface 10 Technical Deep Dive
Uniface Lectures Webinar - Uniface 10 Technical Deep DiveUniface Lectures Webinar - Uniface 10 Technical Deep Dive
Uniface Lectures Webinar - Uniface 10 Technical Deep Dive
 
VB Dot net
VB Dot net VB Dot net
VB Dot net
 
Macros
MacrosMacros
Macros
 
Control de acceso con excel
Control de acceso con excelControl de acceso con excel
Control de acceso con excel
 
โครงการ 5 บท
โครงการ 5 บทโครงการ 5 บท
โครงการ 5 บท
 
โครงการ 5 บท
โครงการ 5 บทโครงการ 5 บท
โครงการ 5 บท
 
Practicalfileofvb workshop
Practicalfileofvb workshopPracticalfileofvb workshop
Practicalfileofvb workshop
 
Vbreport program
Vbreport programVbreport program
Vbreport program
 

More from Dezyneecole

Vinita Vaishnav , BCA Third Year
Vinita Vaishnav , BCA Third YearVinita Vaishnav , BCA Third Year
Vinita Vaishnav , BCA Third YearDezyneecole
 
Vinita Vaishnav , BCA Third Year
Vinita Vaishnav , BCA Third YearVinita Vaishnav , BCA Third Year
Vinita Vaishnav , BCA Third YearDezyneecole
 
Reema Agarwal , BCA Third Year
Reema Agarwal , BCA Third YearReema Agarwal , BCA Third Year
Reema Agarwal , BCA Third YearDezyneecole
 
Ravi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third YearRavi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third YearDezyneecole
 
Ravi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third YearRavi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third YearDezyneecole
 
Ravi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third YearRavi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third YearDezyneecole
 
Ravi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third YearRavi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third YearDezyneecole
 
Kajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third YearKajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third YearDezyneecole
 
Kajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third YearKajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third YearDezyneecole
 
Kajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third YearKajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third YearDezyneecole
 
Kajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third YearKajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third YearDezyneecole
 
Shikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearShikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearDezyneecole
 
Shikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearShikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearDezyneecole
 
Shikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearShikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearDezyneecole
 
Shikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearShikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearDezyneecole
 
Shikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearShikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearDezyneecole
 
Pooja Sharma , BCA Third Year
Pooja Sharma , BCA Third YearPooja Sharma , BCA Third Year
Pooja Sharma , BCA Third YearDezyneecole
 
Pooja Sharma , BCA Third Year
Pooja Sharma , BCA Third YearPooja Sharma , BCA Third Year
Pooja Sharma , BCA Third YearDezyneecole
 
Pooja Sharma , BCA Third Year
Pooja Sharma , BCA Third YearPooja Sharma , BCA Third Year
Pooja Sharma , BCA Third YearDezyneecole
 
Pooja Sharma , BCA Third Year
Pooja Sharma , BCA Third YearPooja Sharma , BCA Third Year
Pooja Sharma , BCA Third YearDezyneecole
 

More from Dezyneecole (20)

Vinita Vaishnav , BCA Third Year
Vinita Vaishnav , BCA Third YearVinita Vaishnav , BCA Third Year
Vinita Vaishnav , BCA Third Year
 
Vinita Vaishnav , BCA Third Year
Vinita Vaishnav , BCA Third YearVinita Vaishnav , BCA Third Year
Vinita Vaishnav , BCA Third Year
 
Reema Agarwal , BCA Third Year
Reema Agarwal , BCA Third YearReema Agarwal , BCA Third Year
Reema Agarwal , BCA Third Year
 
Ravi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third YearRavi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third Year
 
Ravi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third YearRavi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third Year
 
Ravi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third YearRavi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third Year
 
Ravi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third YearRavi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third Year
 
Kajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third YearKajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third Year
 
Kajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third YearKajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third Year
 
Kajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third YearKajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third Year
 
Kajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third YearKajal Gaharwal , BCA Third Year
Kajal Gaharwal , BCA Third Year
 
Shikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearShikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third Year
 
Shikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearShikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third Year
 
Shikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearShikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third Year
 
Shikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearShikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third Year
 
Shikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third YearShikh Mohammad Usman Haidar , BCA Third Year
Shikh Mohammad Usman Haidar , BCA Third Year
 
Pooja Sharma , BCA Third Year
Pooja Sharma , BCA Third YearPooja Sharma , BCA Third Year
Pooja Sharma , BCA Third Year
 
Pooja Sharma , BCA Third Year
Pooja Sharma , BCA Third YearPooja Sharma , BCA Third Year
Pooja Sharma , BCA Third Year
 
Pooja Sharma , BCA Third Year
Pooja Sharma , BCA Third YearPooja Sharma , BCA Third Year
Pooja Sharma , BCA Third Year
 
Pooja Sharma , BCA Third Year
Pooja Sharma , BCA Third YearPooja Sharma , BCA Third Year
Pooja Sharma , BCA Third Year
 

Recently uploaded

Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 

Recently uploaded (20)

Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 

VB Assessment Project for Notepad Application

  • 1. Visual Basic Assessment A WORK REPORT SUBMITTED IN PARTIAL FULLFILLMENT OF THE REQUIREMENT FOR THE DEGREE Bachelors of Computer Application Dezyne E’cole College 106/10, CIVIL LINES AJMER RAJASTHAN - 305001 (INDIA) www.dezyneecole.com TOPIC: Notepad SUBMITTED BY: POOJA SHARMA BCA 3rd YEAR
  • 2. Acknowledgement I Pooja Sharma student of Dezyne E’cole College, extremely grateful to each and every individual who has contributed in successful completion of my project. I express my gratitude towards Dezyne E’cole College to their guidelines and constant supervision as well as for providing the necessary information and support regarding the completion of project. Thanks.
  • 3. Synopsis This project is a minor project made based on practical concepts of Visual Basic. This project has made our basic practical concepts strong.
  • 5. CODING: Form1: Dim rp, fp, a As Variant Dim m%, b%, c%, fd%, d% Option Explicit Const maxUndo = 50 Dim gblnIgnoreChange As Boolean Dim gintIndex As Integer Dim gstrStack(maxUndo) As String Dim stackBK(maxUndo) As String Dim i As Integer Private Sub copy_Click() Call mcop End Sub Public Sub mcop() Clipboard.SetText RichTextBox1.SelText End Sub Private Sub cut_Click() Call mcut End Sub Private Sub edit_Click()
  • 6. If RichTextBox1.SelLength = 0 Then cut.Enabled = False copy.Enabled = False delete.Enabled = False selectall.Enabled = True ElseIf RichTextBox1.SelLength = Len(RichTextBox1.Text) Then cut.Enabled = True copy.Enabled = True delete.Enabled = True selectall.Enabled = False Else cut.Enabled = True copy.Enabled = True delete.Enabled = True selectall.Enabled = True End If If Len(Clipboard.GetText(1)) = 0 Then paste.Enabled = False Else paste.Enabled = True End If End Sub Private Sub munpop_click() If RichTextBox1.SelLength = 0 Then munc.Enabled = False
  • 7. muncop.Enabled = False mundele.Enabled = False munsele.Enabled = True ElseIf RichTextBox1.SelLength = Len(RichTextBox1.Text) Then munc.Enabled = True muncop.Enabled = True mundele.Enabled = True munsele.Enabled = False Else munc.Enabled = True muncop.Enabled = True mundele.Enabled = True munsele.Enabled = True End If If Len(Clipboard.GetText(1)) = 0 Then munpst.Enabled = False Else munpst.Enabled = True End If End Sub Public Sub mcut() Clipboard.SetText RichTextBox1.SelText RichTextBox1.SelText = " " End Sub
  • 8. Private Sub delete_Click() Call mdel End Sub Public Sub mdel() RichTextBox1.SelText = "" RichTextBox1.SelText = "" End Sub Private Sub exit_Click() Unload Me End Sub Private Sub munc_Click() Call mcut End Sub Private Sub muncop_Click() Call mcop End Sub Private Sub mundele_Click() Call mdel End Sub
  • 9. Private Sub munfind_Click() fd = InputBox("Enter Word", "Find") RichTextBox1.Find (fd) End Sub Private Sub munfindnext_Click() Form4.Show End Sub Private Sub Form_Load() Form1.Caption = "Untitled-Notepad" m = 1 RichTextBox1.RightMargin = Screen.Width - (Screen.Width - RichTextBox1.Width - 6000) End Sub Private Sub Form_Resize() RichTextBox1.Width = Form1.Width - 300 RichTextBox1.Height = Form1.Height - 1140 End Sub Private Sub helptopics_Click() On Error Resume Next With CommonDialog1
  • 10. .Flags = 1 .CancelError = True .ShowHelp End With End Sub Private Sub munfont_Click() On Error Resume Next With CommonDialog1 .Flags = 1 .CancelError = True .ShowFont End With RichTextBox1.Font.Name = CommonDialog1.FontName RichTextBox1.Font.Size = CommonDialog1.FontSize RichTextBox1.Font.Bold = CommonDialog1.FontBold RichTextBox1.Font.Italic = CommonDialog1.FontItalic RichTextBox1.Font.Underline = CommonDialog1.FontUnderline RichTextBox1.Font.Strikethrough = CommonDialog1.FontStrikethru End Sub Private Sub munpst_Click() Call mpas End Sub
  • 11. Private Sub munsave_Click() On Error GoTo Label Dim ifile As Integer Dim savefile As Boolean Dim txtbox As Object Dim filepath As String Dim append As Boolean With CommonDialog1 .Flags = 1 .CancelError = True .Filter = "Text Document(*.txt)|*.txt |All Files(*.*)|*.*" If m = 1 Then m = m + 1 .ShowSave End If End With ifile = FreeFile If append Then Open CommonDialog1.FileName For Append As #ifile Else Open CommonDialog1.FileName For Output As #ifile End If Print #ifile, RichTextBox1.Text savefile = True Label:
  • 12. Close #ifile Form1.Caption = CommonDialog1.FileTitle + "-Notepad" End Sub Private Sub munsele_Click() Call msel End Sub Private Sub munund_Click() Call und End Sub Public Sub und() 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 new_Click() On Error Resume Next m = 1
  • 13. If RichTextBox1.Text <> "" Then a = MsgBox("Do you want to save the changes?", vbYesNoCancel + vbQuestion, "Save") If a = vbYes Then With CommonDialog1 .CancelError = True .InitDir = "E:" .Filter = "Text Documents(*.txt)|*.txt | All Files(*.*)|*.*" .ShowSave End With RichTextBox1.Text = "" End If If a = vbNo Then RichTextBox1.Text = " " End If End If End Sub Private Sub notepad_Click() Form2.Show End Sub Private Sub open_Click() On Error Resume Next With CommonDialog1 .CancelError = True
  • 14. .InitDir = "E:" .Filter = "Text Documents(*.txt)|*.txt| All Files(*.*) | *.*" .ShowOpen End With RichTextBox1.LoadFile (CommonDialog1.FileName) End Sub Private Sub paste_Click() Call mpas End Sub Public Sub mpas() If Clipboard.GetFormat(vbCFText) Then RichTextBox1.SelText = Clipboard.GetText(vbCFText) End If End Sub Private Sub print_Click() On Error GoTo Label Dim b, e, n, i As Variant With CommonDialog1 .Flags = 1 .CancelError = True .ShowPrinter b = .FromPage e = .ToPage
  • 15. n = .Copies End With For i = 1 To n Printer.Print RichTextBox1.Text Next Exit Sub Label: Exit Sub End Sub Private Sub replace_Click() Form3.Show 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
  • 16. 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 saveas_Click() On Error GoTo Label Dim ifile As Integer Dim savefile As Boolean Dim txtbox As Object Dim filepath As String Dim append As Boolean With CommonDialog1
  • 17. .Flags = 1 .CancelError = True .Filter = "Text Document(*.txt)|*.txt |All Files(*.*)|*.*" .ShowSave End With ifile = FreeFile If append Then Open CommonDialog1.FileName For Append As #ifile Else Open CommonDialog1.FileName For Output As #ifile End If Print #ifile, RichTextBox1.Text savefile = True Label: Close #ifile Form1.Caption = CommonDialog1.FileTitle + "-Notepad" End Sub Private Sub selectall_Click() Call msel End Sub Public Sub msel() RichTextBox1.SelStart = 0 RichTextBox1.SelLength = Len(RichTextBox1.Text) End Sub
  • 18. Private Sub statusbar_Click() If statusbar.Checked = True Then statusbar.Checked = False StatusBar1.Visible = False RichTextBox1.Height = Form1.Height - 850 Else statusbar.Checked = False statusbar.Checked = True StatusBar1.Visible = True RichTextBox1.Height = RichTextBox1.Height - 375 End If End Sub Private Sub timedate_Click() RichTextBox1.SelText = Now() End Sub Private Sub undo_Click() Call und End Sub Private Sub VScroll1_Change() RichTextBox1.RightMargin = 0 RichTextBox1.Left = 0
  • 19. End Sub Private Sub wordwrap_Click() If wordwrap.Checked = True Then wordwrap.Checked = False RichTextBox1.RightMargin = Screen.Width - (Screen.Width - RichTextBox1.Width - 1000000) Else wordwrap.Checked = True RichTextBox1.RightMargin = Screen.Width - (Screen.Width - RichTextBox1.Width - 6000) End If End Sub Form2: Private Sub Command1_Click() Unload Me End Sub Private Sub Form_Load() Form2.Caption = "About As" End Sub Form3: Option Explicit
  • 20. Dim lastpos As Integer Dim findtext As String Private Sub Command1_Click() findtext = Text1.Text If Check1.Value = vbChecked Then lastpos = InStr(lastpos + 1, Form1.RichTextBox1.Text, findtext, vbBinaryCompare) Else lastpos = InStr(lastpos + 1, Form1.RichTextBox1.Text, findtext, vbTextCompare) End If If lastpos > 0 Then Form1.RichTextBox1.SelStart = lastpos - 1 Form1.RichTextBox1.SelLength = Len(findtext) Else MsgBox "Not Found" End If End Sub Private Sub Command2_Click() Dim fp, a, rp As String fp = Text1.Text rp = Text2.Text a = Form1.RichTextBox1.Find(fp) If a <> -1 Then
  • 21. a = Form1.RichTextBox1.Find(fp) Form1.RichTextBox1.SelText = rp Else MsgBox "Not Found" End If End Sub Private Sub Command3_Click() findtext = Text1.Text lastpos = 0 If Check1.Value = vbChecked Then lastpos = InStr(lastpos + 1, Form1.RichTextBox1.Text, findtext, vbBinaryCompare) Else lastpos = InStr(lastpos + 1, Form1.RichTextBox1.Text, findtext, vbTextCompare) End If If lastpos > 0 Then Do While lastpos > 0 Form1.RichTextBox1.SelStart = lastpos - 1 Form1.RichTextBox1.SelLength = Len(findtext) Form1.RichTextBox1.SelText = Text2.Text If Check1.Value = vbChecked Then lastpos = InStr(lastpos + 1, Form1.RichTextBox1.Text, findtext, vbBinaryCompare) Else lastpos = InStr(lastpos + 1, Form1.RichTextBox1.Text, findtext, vbTextCompare)
  • 22. End If If lastpos = 0 Then MsgBox "All Instances have been replaced" Exit Do End If Loop Else MsgBox "Not Found" End If Form1.RichTextBox1.SelStart = 0 Form1.RichTextBox1.SelLength = 0 End Sub Private Sub Command4_Click() Unload Me End Sub Private Sub Form_Load() Form3.Caption = "Replace" End Sub Private Sub Text1_Change() If Text1 = "" Then Command1.Enabled = False
  • 23. Command2.Enabled = False Command3.Enabled = False Else Command1.Enabled = True Command2.Enabled = True Command3.Enabled = True End If End Sub Form4: Option Explicit Dim lastpos As Integer Dim findtext As String Private Sub Command1_Click() findtext = Text1.Text If Check1.Value = vbChecked Then lastpos = InStr(lastpos + 1, Form1.RichTextBox1.Text, findtext, vbBinaryCompare) Else lastpos = InStr(lastpos + 1, Form1.RichTextBox1.Text, findtext, vbTextCompare) End If If lastpos > 0 Then
  • 24. Form1.RichTextBox1.SelStart = lastpos - 1 Form1.RichTextBox1.SelLength = Len(findtext) Else MsgBox "Not Found" End If Form3.Text1.Text = Text1.Text End Sub Private Sub Command2_Click() Unload Me End Sub Private Sub Form_Load() Form4.Caption = "Find" End Sub
  • 25. THANK YOU Submitted By: Pooja Sharma BCA 3rd Year Dezyne E’cole College