by K.Sandeep Rao (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 12th March 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)
This is a simple notepad application, with just one menu and only for text file. You can modify the code and add new features, especially for
API Declarations
get commondialog control
get richtextbox control
CommonDialog1.DefaultExt = "txt"
CommonDialog1.DialogTitle = "MY NOTEPAD"
CommonDialog1.Filter = "txt files (*.txt)|*.txt"
CommonDialog1.FilterIndex = 2
RichTextBox1.AutoVerbMenu = True
End Sub
Private Sub mnuclose_Click()
Unload Me
End Sub
Private Sub mnunew_Click()
RichTextBox1.Text = ""
End Sub
Private Sub mnuopen_Click()
If RichTextBox1.Text <> "" Then RichTextBox1.Text = ""
CommonDialog1.ShowOpen
If CommonDialog1.FileName = "" Then Exit Sub
Dim tmp As String
Open CommonDialog1.FileName For Input As #1
Do While Not EOF(1)
Line Input #1, tmp
RichTextBox1.Text = RichTextBox1.Text + tmp
Loop
Close #1
End Sub
Private Sub mnusave_Click()
CommonDialog1.ShowSave
If CommonDialog1.FileName = "" Then Exit Sub
Open CommonDialog1.FileName For Output As #1
Print #1, RichTextBox1.Text
Close #1
End Sub
No comments have been posted about This is a simple notepad application, with just one menu and only for text file. You can modify the. Why not be the first to post a comment about This is a simple notepad application, with just one menu and only for text file. You can modify the.