General

Option Explicit

____________________________________
Private Sub mnuFileExit_Click()
'Make sure user really wants to exit
Dim c As string
c = MsgBox("Are you sure you want to exit the note editor?", vbYesNo + vbCritical + vbDefaultButton2, "Exit Editor")
If c = vbNo Then
Exit Sub
Else
End
End If
End Sub
____________________________________
Private Sub mnuFileNew_Click()
'If user wants new file, clear out text
Dim c As stringr
c = MsgBox("Are you sure you want to start a new file?", vbYesNo + vbQuestion, "New File")
If c = vbYes Then txtEdit.Text = ""
End Sub
____________________________________
Private Sub mnuFileOpen_Click()
cdlFiles.Filter = "Files (*.ned)|*.ned" 'open the type of file
cdlFiles.DefaultExt = "ned"
cdlFiles.DialogTitle = "Open File"
cdlFiles.Flags = cdlOFNFileMustExist + cdlOFNPathMustExist
On Error GoTo No_Open
cdlFiles.ShowOpen
Open cdlFiles.FileName For Input As #1 'open the text file into the text box
txtEdit.Text = Input$(LOF(1), 1)
Close 1
Exit Sub
No_Open:
Resume ExitLine
ExitLine:
Exit Sub
End Sub
____________________________________
Private Sub mnuFileSave_Click()
cdlFiles.Filter = "Files (*.ned)|*.ned" 'set the type of file for your saved text
cdlFiles.DefaultExt = "ned"
cdlFiles.DialogTitle = "Save File"
cdlFiles.Flags = cdlOFNOverwritePrompt + cdlOFNPathMustExist
On Error GoTo No_Save 'if theres an error or nothing been done, go to no_save
cdlFiles.ShowSave
Open cdlFiles.FileName For Output As #1
Print #1, txtEdit.Text 'copy whats in the text box
Close 1
Exit Sub
No_Save: 'from error message aboe
Resume ExitLine
ExitLine:
Exit Sub 'close dialog
End Sub

____________________________________
Private Sub mnuFmtBold_Click()
'Toggle bold font status
mnuFmtBold.Checked = Not (mnuFmtBold.Checked)
txtEdit.FontBold = Not (txtEdit.FontBold)
End Sub
____________________________________

Private Sub mnuFmtItalic_Click()
'Toggle italic font status
mnuFmtItalic.Checked = Not (mnuFmtItalic.Checked)
txtEdit.FontItalic = Not (txtEdit.FontItalic)
End Sub

____________________________________
Private Sub mnuFmtSizeLarge_Click()
'Set font size to large
mnuFmtSizeSmall.Checked = False
mnuFmtSizeMedium.Checked = False
mnuFmtSizeLarge.Checked = True
txtEdit.FontSize = 18 ' set the size for text box
End Sub
____________________________________
Private Sub mnuFmtSizeMedium_Click()
'Set font size to medium
mnuFmtSizeSmall.Checked = False
mnuFmtSizeMedium.Checked = True
mnuFmtSizeLarge.Checked = False
txtEdit.FontSize = 12 ' set the size for text box
End Sub
____________________________________
Private Sub mnuFmtSizeSmall_Click()
'Set font size to small
mnuFmtSizeSmall.Checked = True
mnuFmtSizeMedium.Checked = False
mnuFmtSizeLarge.Checked = False
txtEdit.FontSize = 8 ' set the size for text box
End Sub
____________________________________
Private Sub mnuFmtUnderline_Click()
'Toggle underline font status
mnuFmtUnderline.Checked = Not (mnuFmtUnderline.Checked)
txtEdit.FontUnderline = Not (txtEdit.FontUnderline)
End Sub