home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmNotePad
- Caption = "
- ClientHeight = 3990
- ClientLeft = 1515
- ClientTop = 3315
- ClientWidth = 5775
- BeginProperty Font
- Name = "
- Size = 9
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- LinkTopic = "Form1"
- MDIChild = -1 'True
- ScaleHeight = 3990
- ScaleMode = 0 'User
- ScaleWidth = 102.941
- Begin VB.TextBox Text1
- BeginProperty Font
- Name = "
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 3975
- HideSelection = 0 'False
- Left = 0
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 0
- Top = 0
- Width = 5655
- End
- Begin VB.Menu mnuFile
- Caption = "
- (&F)"
- Begin VB.Menu mnuFileNew
- Caption = "
- (&N)"
- End
- Begin VB.Menu mnuFileOpen
- Caption = "
- (&O)..."
- End
- Begin VB.Menu mnuFileClose
- Caption = "
- (&C)"
- End
- Begin VB.Menu mnuFileSave
- Caption = "
- (&S)"
- End
- Begin VB.Menu mnuFileSaveAs
- Caption = "
- (&A)..."
- End
- Begin VB.Menu mnuFSep
- Caption = "-"
- End
- Begin VB.Menu mnuFileExit
- Caption = "
- (&X)"
- End
- Begin VB.Menu mnuRecentFile
- Caption = "-"
- Index = 0
- Visible = 0 'False
- End
- Begin VB.Menu mnuRecentFile
- Caption = "RecentFile1"
- Index = 1
- Visible = 0 'False
- End
- Begin VB.Menu mnuRecentFile
- Caption = "RecentFile2"
- Index = 2
- Visible = 0 'False
- End
- Begin VB.Menu mnuRecentFile
- Caption = "RecentFile3"
- Index = 3
- Visible = 0 'False
- End
- Begin VB.Menu mnuRecentFile
- Caption = "RecentFile4"
- Index = 4
- Visible = 0 'False
- End
- Begin VB.Menu mnuRecentFile
- Caption = "RecentFile5"
- Index = 5
- Visible = 0 'False
- End
- End
- Begin VB.Menu mnuEdit
- Caption = "
- (&E)"
- Begin VB.Menu mnuEditCut
- Caption = "
- (&U)"
- Shortcut = ^X
- End
- Begin VB.Menu mnuEditCopy
- Caption = "
- (&C)"
- Shortcut = ^C
- End
- Begin VB.Menu mnuEditPaste
- Caption = "
- (&P)"
- Shortcut = ^V
- End
- Begin VB.Menu mnuEditDelete
- Caption = "
- (&L)"
- Shortcut = {DEL}
- End
- Begin VB.Menu mnuESep1
- Caption = "-"
- End
- Begin VB.Menu mnuEditSelectAll
- Caption = "
- (&A)"
- End
- Begin VB.Menu mnuEditTime
- Caption = "
- (&D)"
- End
- End
- Begin VB.Menu mnuSearch
- Caption = "
- (&S)"
- Begin VB.Menu mnuSearchFind
- Caption = "
- (&F)"
- End
- Begin VB.Menu mnuSearchFindNext
- Caption = "
- (&N)"
- Shortcut = {F3}
- End
- End
- Begin VB.Menu mnuOptions
- Caption = "
- (&O)"
- Begin VB.Menu mnuOptionsToolbar
- Caption = "
- (&T)"
- End
- Begin VB.Menu mnuFont
- Caption = "
- (&F)"
- Begin VB.Menu mnuFontName
- Caption = "
- Index = 0
- End
- End
- End
- Begin VB.Menu mnuWindow
- Caption = "
- (&W)"
- WindowList = -1 'True
- Begin VB.Menu mnuWindowCascade
- Caption = "
- (&C)"
- End
- Begin VB.Menu mnuWindowTile
- Caption = "
- (&T)"
- End
- Begin VB.Menu mnuWindowArrange
- Caption = "
- (&A)"
- End
- End
- Attribute VB_Name = "frmNotePad"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '*** MDI
- ***
- '*******************************************************
- Option Explicit
- Private Sub Form_Load()
- Dim i As Integer '
- '
- mnuFontName(0).Caption = Screen.Fonts(0)
- For i = 1 To Screen.FontCount - 1
- Load mnuFontName(i)
- mnuFontName(0).Caption = Screen.Fonts(i)
- Next
- End Sub
- Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
- Dim strMsg As String
- Dim strFilename As String
- Dim intResponse As Integer
- '
- If FState(Me.Tag).Dirty Then
- strFilename = Me.Caption
- strMsg = "[" & strFilename & "]
- strMsg = strMsg & vbCrLf
- strMsg = strMsg & "
- intResponse = MsgBox(strMsg, 51, frmMDI.Caption)
- Select Case intResponse
- Case 6 '
- If Left(Me.Caption, 3) = "
- " Then
- '
- strFilename = "
- .txt"
- '
- strFilename
- GetstrFilename.
- strFilename = GetFileName(strFilename)
- Else
- '
- strFilename = Me.Caption
- End If
- '
- '
- strFilename = Empty
- If strFilename <> "" Then
- SaveFileAs strFilename
- End If
- Case 7 '
- Cancel = False
- Case 2 '
- Cancel = True
- End Select
- End If
- End Sub
- Private Sub Form_Resize()
- '
- Text1.Height = ScaleHeight
- Text1.Width = ScaleWidth
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- '
- FState(Me.Tag).Deleted = True
- '
- If Not AnyPadsLeft() Then
- frmMDI.imgCutButton.Visible = False
- frmMDI.imgCopyButton.Visible = False
- frmMDI.imgPasteButton.Visible = False
- '
- gToolsHidden = True
- '
- GetRecentFiles
- End If
- End Sub
- Private Sub mnuEditCopy_Click()
- '
- EditCopyProc
- End Sub
- Private Sub mnuEditCut_Click()
- '
- EditCutProc
- End Sub
- Private Sub mnuEditDelete_Click()
- '
- If Screen.ActiveControl.SelStart <> Len(Screen.ActiveControl.Text) Then
- '
- If Screen.ActiveControl.SelLength = 0 Then
- Screen.ActiveControl.SelLength = 1
- '
- If Asc(Screen.ActiveControl.SelText) = 13 Then
- Screen.ActiveControl.SelLength = 2
- End If
- End If
- '
- Screen.ActiveControl.SelText = ""
- End If
- End Sub
- Private Sub mnuEditPaste_Click()
- '
- EditPasteProc
- End Sub
- Private Sub mnuEditSelectAll_Click()
- '
- SelStart
- SelLength
- frmMDI.ActiveForm.Text1.SelStart = 0
- frmMDI.ActiveForm.Text1.SelLength = Len(frmMDI.ActiveForm.Text1.Text)
- End Sub
- Private Sub mnuEditTime_Click()
- '
- Text1.SelText = Now
- End Sub
- Private Sub mnuFileClose_Click()
- '
- Unload Me
- End Sub
- Private Sub mnuFileExit_Click()
- MDI
- MDI
- QueryUnload
- QueryUnload
- Cancel
- True
- Unload frmMDI
- End Sub
- Private Sub mnuFileNew_Click()
- '
- FileNew
- End Sub
- Private Sub mnuFontName_Click(index As Integer)
- '
- textbox
- fontname
- Text1.FontName = mnuFontName(index).Caption
- End Sub
- Private Sub mnuFileOpen_Click()
- '
- FileOpenProc
- End Sub
- Private Sub mnuFileSave_Click()
- Dim strFilename As String
- If Left(Me.Caption, 3) = "
- " Then
- '
- '
- GetFileName
- strFilename = GetFileName(strFilename)
- Else
- '
- strFilename = Me.Caption
- End If
- '
- '
- Filename = Empty
- If strFilename <> "" Then
- SaveFileAs strFilename
- End If
- End Sub
- Private Sub mnuFileSaveAs_Click()
- Dim strSaveFileName As String
- Dim strDefaultName As String
- '
- strDefaultName = Me.Caption
- If Left(Me.Caption, 3) = "
- " Then
- '
- '
- strSaveFileName
-
- strSaveFileName = GetFileName("
- .txt")
- If strSaveFileName <> "" Then SaveFileAs (strSaveFileName)
- '
- UpdateFileMenu (strSaveFileName)
- Else
- '
-
- strSaveFileName = GetFileName(strDefaultName)
- If strSaveFileName <> "" Then SaveFileAs (strSaveFileName)
- '
- UpdateFileMenu (strSaveFileName)
- End If
- End Sub
- Private Sub mnuOptions_Click()
- '
- Checked
- .Visible
- mnuOptionsToolbar.Checked = frmMDI.picToolbar.Visible
- End Sub
- Private Sub mnuOptionsToolbar_Click()
- '
- OptionsToolbarProc Me
- End Sub
- Private Sub mnuRecentFile_Click(index As Integer)
- '
- OpenFile (mnuRecentFile(index).Caption)
- '
- GetRecentFiles
- End Sub
- Private Sub mnuSearchFind_Click()
- If Me.Text1.SelText <> "" Then
- frmFind.Text1.Text = Me.Text1.SelText
- Else
- frmFind.Text1.Text = gFindString
- End If
- '
- gFirstTime = True
- '
- If (gFindCase) Then
- frmFind.chkCase = 1
- End If
- '
- frmFind.Show vbModal
- End Sub
- Private Sub mnuSearchFindNext_Click()
- '
- If Len(gFindString) > 0 Then
- FindIt
- Else
- mnuSearchFind_Click
- End If
- End Sub
- Private Sub mnuWindowArrange_Click()
- '
- frmMDI.Arrange vbArrangeIcons
- End Sub
- Private Sub mnuWindowCascade_Click()
- '
- frmMDI.Arrange vbCascade
- End Sub
- Private Sub mnuWindowTile_Click()
- '
- frmMDI.Arrange vbTileHorizontal
- End Sub
- Private Sub Text1_Change()
- '
- FState(Me.Tag).Dirty = True
- End Sub
-