home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual BASIC 5.0 (Ent. Edition) / Vb5ent Extractor.EXE / VB / SAMPLES / PGUIDE / SDI / FRMSDI.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-09-16  |  21.8 KB  |  620 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.0#0"; "COMDLG32.OCX"
  3. Begin VB.Form frmSDI 
  4.    Caption         =   "SDI NotePad - Untitled"
  5.    ClientHeight    =   5370
  6.    ClientLeft      =   315
  7.    ClientTop       =   1470
  8.    ClientWidth     =   6690
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   5370
  11.    ScaleWidth      =   6690
  12.    Begin VB.TextBox txtNote 
  13.       Height          =   3975
  14.       HideSelection   =   0   'False
  15.       Left            =   0
  16.       MultiLine       =   -1  'True
  17.       ScrollBars      =   2  'Vertical
  18.       TabIndex        =   0
  19.       Top             =   480
  20.       Width           =   5655
  21.    End
  22.    Begin VB.PictureBox picToolbar 
  23.       Align           =   1  'Align Top
  24.       BeginProperty Font 
  25.          Name            =   "MS Sans Serif"
  26.          Size            =   8.25
  27.          Charset         =   0
  28.          Weight          =   700
  29.          Underline       =   0   'False
  30.          Italic          =   0   'False
  31.          Strikethrough   =   0   'False
  32.       EndProperty
  33.       Height          =   405
  34.       Left            =   0
  35.       ScaleHeight     =   345
  36.       ScaleWidth      =   6630
  37.       TabIndex        =   1
  38.       Top             =   0
  39.       Width           =   6690
  40.       Begin MSComDlg.CommonDialog CMDialog1 
  41.          Left            =   1995
  42.          Top             =   0
  43.          _ExtentX        =   847
  44.          _ExtentY        =   847
  45.          CancelError     =   -1  'True
  46.          DefaultExt      =   "TXT"
  47.          Filter          =   "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
  48.          FilterIndex     =   473
  49.          FontSize        =   7.98198e-38
  50.       End
  51.       Begin VB.Image imgFileNewButton 
  52.          Height          =   330
  53.          Left            =   0
  54.          Picture         =   "frmsdi.frx":0000
  55.          ToolTipText     =   "New File"
  56.          Top             =   0
  57.          Width           =   360
  58.       End
  59.       Begin VB.Image imgFileOpenButton 
  60.          Height          =   330
  61.          Left            =   360
  62.          Picture         =   "frmsdi.frx":018A
  63.          ToolTipText     =   "Open File"
  64.          Top             =   0
  65.          Width           =   360
  66.       End
  67.       Begin VB.Image imgCutButton 
  68.          Height          =   330
  69.          Left            =   840
  70.          Picture         =   "frmsdi.frx":0314
  71.          ToolTipText     =   "Cut"
  72.          Top             =   0
  73.          Width           =   375
  74.       End
  75.       Begin VB.Image imgCopyButton 
  76.          Height          =   330
  77.          Left            =   1200
  78.          Picture         =   "frmsdi.frx":04F6
  79.          ToolTipText     =   "Copy"
  80.          Top             =   0
  81.          Width           =   375
  82.       End
  83.       Begin VB.Image imgPasteButton 
  84.          Height          =   330
  85.          Left            =   1560
  86.          Picture         =   "frmsdi.frx":06D8
  87.          ToolTipText     =   "Paste"
  88.          Top             =   0
  89.          Width           =   375
  90.       End
  91.       Begin VB.Image imgFileNewButtonDn 
  92.          Height          =   330
  93.          Left            =   2040
  94.          Picture         =   "frmsdi.frx":08BA
  95.          Top             =   0
  96.          Visible         =   0   'False
  97.          Width           =   375
  98.       End
  99.       Begin VB.Image imgFileNewButtonUp 
  100.          Height          =   330
  101.          Left            =   2400
  102.          Picture         =   "frmsdi.frx":0A9C
  103.          Top             =   0
  104.          Visible         =   0   'False
  105.          Width           =   360
  106.       End
  107.       Begin VB.Image imgFileOpenButtonUp 
  108.          Height          =   330
  109.          Left            =   3120
  110.          Picture         =   "frmsdi.frx":0C26
  111.          Top             =   0
  112.          Visible         =   0   'False
  113.          Width           =   360
  114.       End
  115.       Begin VB.Image imgFileOpenButtonDn 
  116.          Height          =   330
  117.          Left            =   2760
  118.          Picture         =   "frmsdi.frx":0DB0
  119.          Top             =   0
  120.          Visible         =   0   'False
  121.          Width           =   360
  122.       End
  123.       Begin VB.Image imgCutButtonUp 
  124.          Height          =   330
  125.          Left            =   3480
  126.          Picture         =   "frmsdi.frx":0F3A
  127.          Top             =   0
  128.          Visible         =   0   'False
  129.          Width           =   375
  130.       End
  131.       Begin VB.Image imgCutButtonDn 
  132.          Height          =   330
  133.          Left            =   3840
  134.          Picture         =   "frmsdi.frx":111C
  135.          Top             =   0
  136.          Visible         =   0   'False
  137.          Width           =   375
  138.       End
  139.       Begin VB.Image imgCopyButtonUp 
  140.          Height          =   330
  141.          Left            =   4560
  142.          Picture         =   "frmsdi.frx":12FE
  143.          Top             =   0
  144.          Visible         =   0   'False
  145.          Width           =   375
  146.       End
  147.       Begin VB.Image imgCopyButtonDn 
  148.          Height          =   330
  149.          Left            =   4200
  150.          Picture         =   "frmsdi.frx":14E0
  151.          Top             =   0
  152.          Visible         =   0   'False
  153.          Width           =   375
  154.       End
  155.       Begin VB.Image imgPasteButtonDn 
  156.          Height          =   330
  157.          Left            =   4920
  158.          Picture         =   "frmsdi.frx":16C2
  159.          Top             =   0
  160.          Visible         =   0   'False
  161.          Width           =   375
  162.       End
  163.       Begin VB.Image imgPasteButtonUp 
  164.          Height          =   330
  165.          Left            =   5280
  166.          Picture         =   "frmsdi.frx":18A4
  167.          Top             =   0
  168.          Visible         =   0   'False
  169.          Width           =   375
  170.       End
  171.    End
  172.    Begin VB.Menu mnuFile 
  173.       Caption         =   "&File"
  174.       Begin VB.Menu mnuFileNew 
  175.          Caption         =   "&New"
  176.       End
  177.       Begin VB.Menu mnuFileOpen 
  178.          Caption         =   "&Open"
  179.       End
  180.       Begin VB.Menu mnuFileSave 
  181.          Caption         =   "&Save"
  182.       End
  183.       Begin VB.Menu mnuFileSaveAs 
  184.          Caption         =   "Save &As"
  185.       End
  186.       Begin VB.Menu mnuFSep1 
  187.          Caption         =   "-"
  188.       End
  189.       Begin VB.Menu mnuFileExit 
  190.          Caption         =   "E&xit"
  191.       End
  192.       Begin VB.Menu mnuRecentFile 
  193.          Caption         =   "-"
  194.          Index           =   0
  195.          Visible         =   0   'False
  196.       End
  197.       Begin VB.Menu mnuRecentFile 
  198.          Caption         =   "RecentFile1"
  199.          Index           =   1
  200.          Visible         =   0   'False
  201.       End
  202.       Begin VB.Menu mnuRecentFile 
  203.          Caption         =   "RecentFile2"
  204.          Index           =   2
  205.          Visible         =   0   'False
  206.       End
  207.       Begin VB.Menu mnuRecentFile 
  208.          Caption         =   "RecentFile3"
  209.          Index           =   3
  210.          Visible         =   0   'False
  211.       End
  212.       Begin VB.Menu mnuRecentFile 
  213.          Caption         =   "RecentFile4"
  214.          Index           =   4
  215.          Visible         =   0   'False
  216.       End
  217.       Begin VB.Menu mnuRecentFile 
  218.          Caption         =   "RecentFile5"
  219.          Index           =   5
  220.          Visible         =   0   'False
  221.       End
  222.    End
  223.    Begin VB.Menu mnuEdit 
  224.       Caption         =   "&Edit"
  225.       Begin VB.Menu mnuEditCut 
  226.          Caption         =   "Cu&t"
  227.          Shortcut        =   ^X
  228.       End
  229.       Begin VB.Menu mnuEditCopy 
  230.          Caption         =   "&Copy"
  231.          Shortcut        =   ^C
  232.       End
  233.       Begin VB.Menu mnuEditPaste 
  234.          Caption         =   "&Paste"
  235.          Shortcut        =   ^V
  236.       End
  237.       Begin VB.Menu mnuEditDelete 
  238.          Caption         =   "De&lete"
  239.          Shortcut        =   {DEL}
  240.       End
  241.       Begin VB.Menu mnuEditSep1 
  242.          Caption         =   "-"
  243.       End
  244.       Begin VB.Menu mnuEditSelectAll 
  245.          Caption         =   "Select &All"
  246.       End
  247.       Begin VB.Menu mnuEditTime 
  248.          Caption         =   "Time / &Date"
  249.       End
  250.    End
  251.    Begin VB.Menu mnuSearch 
  252.       Caption         =   "&Search"
  253.       Begin VB.Menu mnuSearchFind 
  254.          Caption         =   "&Find"
  255.       End
  256.       Begin VB.Menu mnuSearchFindNext 
  257.          Caption         =   "Find &Next"
  258.          Shortcut        =   {F3}
  259.       End
  260.    End
  261.    Begin VB.Menu mnuOptions 
  262.       Caption         =   "&Options"
  263.       Begin VB.Menu mnuOptionsToolbar 
  264.          Caption         =   "&Toolbar"
  265.       End
  266.       Begin VB.Menu mnuFonts 
  267.          Caption         =   "&Fonts"
  268.          Begin VB.Menu mnuFontName 
  269.             Caption         =   "FontName"
  270.             Index           =   0
  271.          End
  272.       End
  273.       Begin VB.Menu mnuOptionsLaunch 
  274.          Caption         =   "&Launch New Instance"
  275.       End
  276.    End
  277. Attribute VB_Name = "frmSDI"
  278. Attribute VB_Base = "0{8EC00D4C-E9E4-11CF-84BA-00AA00C007F0}"
  279. Attribute VB_GlobalNameSpace = False
  280. Attribute VB_Creatable = False
  281. Attribute VB_TemplateDerived = False
  282. Attribute VB_PredeclaredId = True
  283. Attribute VB_Exposed = False
  284. '*** Main form for the SDI Notepad sample application  ***
  285. '**********************************************************
  286. Option Explicit
  287. Private Sub Form_Load()
  288.     Dim i As Integer        ' Counter variable.
  289.     ' Application starts here (Load event of Startup form).
  290.     Show
  291.     ' Always set the working directory to the directory containing the application.
  292.     ChDir App.Path
  293.     FState.Dirty = False
  294.     ' Read System registry and set the recent menu file list control array appropriately.
  295.     GetRecentFiles
  296.     ' Set public variable gFindDirection which determines which direction
  297.     ' the FindIt function will search in.
  298.     gFindDirection = 1
  299.         
  300.     ' Assign the name of the first font to a font
  301.     ' menu entry, then loop through the fonts
  302.     ' collection, adding them to the menu
  303.     mnuFontName(0).Caption = Screen.Fonts(0)
  304.     For i = 1 To Screen.FontCount - 1
  305.         Load mnuFontName(i)
  306.         mnuFontName(0).Caption = Screen.Fonts(i)
  307.     Next
  308. End Sub
  309. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  310.     Dim strMsg As String
  311.     Dim strFilename As String
  312.     Dim intResponse As Integer
  313.     ' Check to see if the text has been changed.
  314.     If FState.Dirty Then
  315.         strFilename = Me.Caption
  316.         strMsg = "The text in [" & strFilename & "] has changed."
  317.         strMsg = strMsg & vbCrLf
  318.         strMsg = strMsg & "Do you want to save the changes?"
  319.         intResponse = MsgBox(strMsg, 51, frmSDI.Caption)
  320.         Select Case intResponse
  321.             Case 6      ' User chose Yes.
  322.                 If Left(Me.Caption, 8) = "Untitled" Then
  323.                     ' The file hasn't been saved yet.
  324.                     strFilename = "untitled.txt"
  325.                     ' Get the strFilename, and then call the save procedure, GetstrFilename.
  326.                     strFilename = GetFileName(strFilename)
  327.                 Else
  328.                     ' The form's Caption contains the name of the open file.
  329.                     strFilename = Me.Caption
  330.                 End If
  331.                 ' Call the save procedure. If strFilename = Empty, then
  332.                 ' the user chose Cancel in the Save As dialog box; otherwise,
  333.                 ' save the file.
  334.                 If strFilename <> "" Then
  335.                     SaveFileAs strFilename
  336.                 End If
  337.             Case 7      ' User chose No. Unload the file.
  338.                 Cancel = False
  339.             Case 2      ' User chose Cancel. Cancel the unload.
  340.                 Cancel = True
  341.         End Select
  342.     End If
  343. End Sub
  344. Private Sub Form_Resize()
  345.     ' Call the resize procedure
  346.     ResizeNote
  347. End Sub
  348. Private Sub Form_Unload(Cancel As Integer)
  349.     ' Call the recent file list procedure
  350.     GetRecentFiles
  351. End Sub
  352. Private Sub imgCopyButton_Click()
  353.     ' Refresh the image.
  354.     imgCopyButton.Refresh
  355.     ' Call the copy procedure
  356.     EditCopyProc
  357. End Sub
  358. Private Sub imgCopyButton_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  359.     ' Show the picture for the down state.
  360.     imgCopyButton.Picture = imgCopyButtonDn.Picture
  361. End Sub
  362. Private Sub imgCopyButton_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  363.     ' If the button is pressed, display the up bitmap when the
  364.     ' mouse is dragged outside the button's area; otherwise
  365.     ' display the down bitmap.
  366.     Select Case Button
  367.     Case 1
  368.         If X <= 0 Or X > imgCopyButton.Width Or Y < 0 Or Y > imgCopyButton.Height Then
  369.             imgCopyButton.Picture = imgCopyButtonUp.Picture
  370.         Else
  371.             imgCopyButton.Picture = imgCopyButtonDn.Picture
  372.         End If
  373.     End Select
  374. End Sub
  375. Private Sub imgCopyButton_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  376.     ' Show the picture for the up state.
  377.     imgCopyButton.Picture = imgCopyButtonUp.Picture
  378. End Sub
  379. Private Sub imgCutButton_Click()
  380.     ' Refresh the image.
  381.     imgCutButton.Refresh
  382.     ' Call the cut procedure
  383.     EditCutProc
  384. End Sub
  385. Private Sub imgCutButton_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  386.     ' Show the picture for the down state.
  387.     imgCutButton.Picture = imgCutButtonDn.Picture
  388. End Sub
  389. Private Sub imgCutButton_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  390.     ' If the button is pressed, display the up bitmap when the
  391.     ' mouse is dragged outside the button's area; otherwise,
  392.     ' display the down bitmap.
  393.     Select Case Button
  394.     Case 1
  395.         If X <= 0 Or X > imgCutButton.Width Or Y < 0 Or Y > imgCutButton.Height Then
  396.             imgCutButton.Picture = imgCutButtonUp.Picture
  397.         Else
  398.             imgCutButton.Picture = imgCutButtonDn.Picture
  399.         End If
  400.     End Select
  401. End Sub
  402. Private Sub imgCutButton_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  403.     ' Show the picture for the up state.
  404.     imgCutButton.Picture = imgCutButtonUp.Picture
  405. End Sub
  406. Private Sub imgFileNewButton_Click()
  407.     ' Refresh the image.
  408.     imgFileNewButton.Refresh
  409.     ' Call the new file procedure
  410.     FileNew
  411. End Sub
  412. Private Sub imgFileNewButton_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  413.     ' Show the picture for the down state.
  414.     imgFileNewButton.Picture = imgFileNewButtonDn.Picture
  415. End Sub
  416. Private Sub imgFileNewButton_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  417.     ' If the button is pressed, display the up bitmap when the
  418.     ' mouse is dragged outside the button's area; otherwise,
  419.     ' display the down bitmap.
  420.     Select Case Button
  421.     Case 1
  422.         If X <= 0 Or X > imgFileNewButton.Width Or Y < 0 Or Y > imgFileNewButton.Height Then
  423.             imgFileNewButton.Picture = imgFileNewButtonUp.Picture
  424.         Else
  425.             imgFileNewButton.Picture = imgFileNewButtonDn.Picture
  426.         End If
  427.     End Select
  428. End Sub
  429. Private Sub imgFileNewButton_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  430.     ' Show the picture for the up state.
  431.     imgFileNewButton.Picture = imgFileNewButtonUp.Picture
  432. End Sub
  433. Private Sub imgFileOpenButton_Click()
  434.     ' Refresh the image.
  435.     imgFileOpenButton.Refresh
  436.     ' Call the file open procedure
  437.     FileOpenProc
  438. End Sub
  439. Private Sub imgFileOpenButton_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  440.     ' Show the picture for the down state.
  441.     imgFileOpenButton.Picture = imgFileOpenButtonDn.Picture
  442. End Sub
  443. Private Sub imgFileOpenButton_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  444.     ' If the button is pressed, display the up bitmap when the
  445.     ' mouse is dragged outside the button's area; otherwise,
  446.     ' display the down bitmap.
  447.     Select Case Button
  448.     Case 1
  449.         If X <= 0 Or X > imgFileOpenButton.Width Or Y < 0 Or Y > imgFileOpenButton.Height Then
  450.             imgFileOpenButton.Picture = imgFileOpenButtonUp.Picture
  451.         Else
  452.             imgFileOpenButton.Picture = imgFileOpenButtonDn.Picture
  453.         End If
  454.     End Select
  455. End Sub
  456. Private Sub imgFileOpenButton_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  457.     ' Show the picture for the up state.
  458.     imgFileOpenButton.Picture = imgFileOpenButtonUp.Picture
  459. End Sub
  460. Private Sub imgPasteButton_Click()
  461.     ' Refresh the image.
  462.     imgPasteButton.Refresh
  463.     ' Call the paste procedure
  464.     EditPasteProc
  465. End Sub
  466. Private Sub imgPasteButton_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  467.     ' Show the picture for the down state.
  468.     imgPasteButton.Picture = imgPasteButtonDn.Picture
  469. End Sub
  470. Private Sub imgPasteButton_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  471.     ' If the button is pressed, display the up bitmap when the
  472.     ' mouse is dragged outside the button's area; otherwise,
  473.     ' display the down bitmap.
  474.     Select Case Button
  475.     Case 1
  476.         If X <= 0 Or X > imgPasteButton.Width Or Y < 0 Or Y > imgPasteButton.Height Then
  477.             imgPasteButton.Picture = imgPasteButtonUp.Picture
  478.         Else
  479.             imgPasteButton.Picture = imgPasteButtonDn.Picture
  480.         End If
  481.     End Select
  482. End Sub
  483. Private Sub imgPasteButton_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  484.     ' Show the picture for the up state.
  485.     imgPasteButton.Picture = imgPasteButtonUp.Picture
  486. End Sub
  487. Private Sub mnuEditCopy_Click()
  488.     ' Call the copy procedure
  489.     EditCopyProc
  490. End Sub
  491. Private Sub mnuEditCut_Click()
  492.     ' Call the cut procedure
  493.     EditCutProc
  494. End Sub
  495. Private Sub mnuEditDelete_Click()
  496. ' If the mouse pointer is not at the end of the notepad...
  497.     If txtNote.SelStart <> Len(Screen.ActiveControl.Text) Then
  498.         ' If nothing is selected, extend the selection by one.
  499.         If txtNote.SelLength = 0 Then
  500.             txtNote.SelLength = 1
  501.             ' If the mouse pointer is on a blank line, extend the selection by two.
  502.             If Asc(txtNote.SelText) = 13 Then
  503.                 txtNote.SelLength = 2
  504.             End If
  505.         End If
  506.         ' Delete the selected text.
  507.         txtNote.SelText = ""
  508.     End If
  509. End Sub
  510. Private Sub mnuEditPaste_Click()
  511.     ' Call the paste procedure.
  512.     EditPasteProc
  513. End Sub
  514. Private Sub mnuEditSelectAll_Click()
  515.     ' Use SelStart & SelLength to select the text.
  516.     txtNote.SelStart = 0
  517.     txtNote.SelLength = Len(txtNote.Text)
  518. End Sub
  519. Private Sub mnuEditTime_Click()
  520.     ' Insert the current time and date.
  521.     txtNote.SelText = Now
  522. End Sub
  523. Private Sub mnuFileExit_Click()
  524.     ' End the application.
  525.     Unload Me
  526. End Sub
  527. Public Sub mnuFileNew_Click()
  528.     ' Call the new form procedure
  529.     FileNew
  530. End Sub
  531. Private Sub mnuFileOpen_Click()
  532.     ' Call the file open procedure.
  533.     FileOpenProc
  534. End Sub
  535. Private Sub mnuFileSave_Click()
  536.     'Call the file save procedure
  537.     FileSave
  538. End Sub
  539. Private Sub mnuFileSaveAs_Click()
  540.     Dim strSaveFileName As String
  541.     Dim strDefaultName As String
  542.     ' Assign the form caption to the variable.
  543.     strDefaultName = Right$(Me.Caption, Len(Me.Caption) - 14)
  544.     If Me.Caption = "SDI NotePad - Untitled" Then
  545.         ' The file hasn't been saved yet.
  546.         ' Get the filename, and then call the save procedure, strSaveFileName.
  547.         
  548.         strSaveFileName = GetFileName("Untitled.txt")
  549.         If strSaveFileName <> "" Then SaveFileAs (strSaveFileName)
  550.         ' Update the list of recently opened files in the File menu control array.
  551.         UpdateFileMenu (strSaveFileName)
  552.     Else
  553.         ' The form's Caption contains the name of the open file.
  554.         strSaveFileName = GetFileName(strDefaultName)
  555.         If strSaveFileName <> "" Then SaveFileAs (strSaveFileName)
  556.         ' Update the list of recently opened files in the File menu control array.
  557.         UpdateFileMenu (strSaveFileName)
  558.     End If
  559. End Sub
  560. Private Sub mnuFontName_Click(Index As Integer)
  561.     ' Assign the selected font to the textbox fontname property.
  562.     txtNote.FontName = mnuFontName(Index).Caption
  563. End Sub
  564. Private Sub mnuOptions_Click()
  565.     ' Toggle the Checked property to match the .Visible property.
  566.     mnuOptionsToolbar.Checked = picToolbar.Visible
  567. End Sub
  568. Private Sub mnuOptionsLaunch_Click()
  569.     Dim strApp As String
  570.     ' Shell a new instance of the notepad.
  571.     strApp = App.Path & "\" & App.EXEName
  572.     Shell strApp, 1
  573. End Sub
  574. Private Sub mnuOptionsToolbar_Click()
  575.     ' Toggle the visible property of the toolbar
  576.     picToolbar.Visible = Not picToolbar.Visible
  577.     ' Change the check to match the current state
  578.     mnuOptionsToolbar.Checked = picToolbar.Visible
  579.     ' Call the resize procedure
  580.     ResizeNote
  581. End Sub
  582. Private Sub mnuRecentFile_Click(Index As Integer)
  583.     ' Call the file open procedure, passing a
  584.     ' reference to the selected file name
  585.     OpenFile (mnuRecentFile(Index).Caption)
  586.     ' Update the list of recently opened files in the File menu control array.
  587.     GetRecentFiles
  588. End Sub
  589. Private Sub mnuSearchFind_Click()
  590.     ' If there is text in the textbox, assign it to
  591.     ' the textbox on the Find form, otherwise assign
  592.     ' the last findtext value.
  593.     If txtNote.SelText <> "" Then
  594.         frmFind.txtFind.Text = txtNote.SelText
  595.     Else
  596.         frmFind.txtFind.Text = gFindString
  597.     End If
  598.     ' Set the public variable to start at the beginning.
  599.     gFirstTime = True
  600.     ' Set the case checkbox to match the public variable
  601.     If (gFindCase) Then
  602.         frmFind.chkCase = 1
  603.     End If
  604.     ' Display the Find form.
  605.     frmFind.Show vbModal
  606. End Sub
  607. Private Sub mnuSearchFindNext_Click()
  608.     ' If the public variable isn't empty, call the
  609.     ' find procedure, otherwise call the find menu
  610.     If Len(gFindString) > 0 Then
  611.         FindIt
  612.     Else
  613.         mnuSearchFind_Click
  614.     End If
  615. End Sub
  616. Private Sub txtNote_Change()
  617.     ' Set the public variable to show that text has changed.
  618.     FState.Dirty = True
  619. End Sub
  620.