This is a simple notepad application, with just one menu and only for text file. You can modify the
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
Rate This is a simple notepad application, with just one menu and only for text file. You can modify the
(1(1 Vote))
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
This is a simple notepad application, with just one menu and only for text file. You can modify the Comments
No comments yet — be the first to post one!
Post a Comment