home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / multid1a / mod1.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-07-15  |  35.9 KB  |  1,181 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
  3. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  4. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.1#0"; "RICHTX32.OCX"
  5. Begin VB.Form frm1 
  6.    Caption         =   "MultiDoc     Blank.txt"
  7.    ClientHeight    =   5805
  8.    ClientLeft      =   705
  9.    ClientTop       =   990
  10.    ClientWidth     =   8280
  11.    Icon            =   "Mod1.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    PaletteMode     =   1  'UseZOrder
  15.    ScaleHeight     =   5805
  16.    ScaleWidth      =   8280
  17.    WindowState     =   2  'Maximized
  18.    Begin VB.Frame fraNew 
  19.       Caption         =   "Create New File"
  20.       BeginProperty Font 
  21.          Name            =   "MS Sans Serif"
  22.          Size            =   8.25
  23.          Charset         =   0
  24.          Weight          =   700
  25.          Underline       =   0   'False
  26.          Italic          =   0   'False
  27.          Strikethrough   =   0   'False
  28.       EndProperty
  29.       ForeColor       =   &H00FF0000&
  30.       Height          =   930
  31.       Left            =   1965
  32.       TabIndex        =   27
  33.       Top             =   2220
  34.       Visible         =   0   'False
  35.       Width           =   4605
  36.       Begin VB.CommandButton cmdOK 
  37.          Caption         =   "&Cancel"
  38.          Height          =   315
  39.          Index           =   1
  40.          Left            =   3270
  41.          TabIndex        =   31
  42.          Top             =   525
  43.          Width           =   1230
  44.       End
  45.       Begin VB.CommandButton cmdOK 
  46.          Caption         =   "&OK"
  47.          Height          =   315
  48.          Index           =   0
  49.          Left            =   3270
  50.          TabIndex        =   30
  51.          Top             =   195
  52.          Width           =   1230
  53.       End
  54.       Begin VB.ComboBox cboNew 
  55.          Height          =   315
  56.          ItemData        =   "Mod1.frx":058A
  57.          Left            =   1590
  58.          List            =   "Mod1.frx":0594
  59.          TabIndex        =   29
  60.          Text            =   "TXT"
  61.          ToolTipText     =   "Extension"
  62.          Top             =   195
  63.          Width           =   1500
  64.       End
  65.       Begin VB.TextBox txtNew 
  66.          Height          =   315
  67.          Left            =   60
  68.          TabIndex        =   28
  69.          Text            =   "Blank"
  70.          ToolTipText     =   "FileName"
  71.          Top             =   195
  72.          Width           =   1500
  73.       End
  74.    End
  75.    Begin VB.Frame fraTools 
  76.       Caption         =   "Tools"
  77.       BeginProperty Font 
  78.          Name            =   "MS Sans Serif"
  79.          Size            =   8.25
  80.          Charset         =   0
  81.          Weight          =   700
  82.          Underline       =   0   'False
  83.          Italic          =   0   'False
  84.          Strikethrough   =   0   'False
  85.       EndProperty
  86.       ForeColor       =   &H00FF0000&
  87.       Height          =   1500
  88.       Left            =   0
  89.       TabIndex        =   18
  90.       Top             =   0
  91.       Width           =   1725
  92.       Begin VB.CommandButton cmdClear 
  93.          Height          =   315
  94.          Left            =   1320
  95.          Picture         =   "Mod1.frx":05A2
  96.          Style           =   1  'Graphical
  97.          TabIndex        =   39
  98.          ToolTipText     =   "New"
  99.          Top             =   825
  100.          Width           =   315
  101.       End
  102.       Begin VB.CommandButton cmdCase 
  103.          Enabled         =   0   'False
  104.          Height          =   315
  105.          Index           =   1
  106.          Left            =   1320
  107.          Picture         =   "Mod1.frx":08E4
  108.          Style           =   1  'Graphical
  109.          TabIndex        =   38
  110.          ToolTipText     =   "lowercase"
  111.          Top             =   200
  112.          Width           =   315
  113.       End
  114.       Begin VB.CommandButton cmdCase 
  115.          Enabled         =   0   'False
  116.          Height          =   315
  117.          Index           =   0
  118.          Left            =   1005
  119.          Picture         =   "Mod1.frx":0C26
  120.          Style           =   1  'Graphical
  121.          TabIndex        =   37
  122.          ToolTipText     =   "UPPERCASE"
  123.          Top             =   200
  124.          Width           =   315
  125.       End
  126.       Begin VB.OptionButton optAlign 
  127.          Height          =   315
  128.          Index           =   0
  129.          Left            =   60
  130.          Picture         =   "Mod1.frx":0F68
  131.          Style           =   1  'Graphical
  132.          TabIndex        =   36
  133.          ToolTipText     =   "Left Align"
  134.          Top             =   200
  135.          Value           =   -1  'True
  136.          Width           =   315
  137.       End
  138.       Begin VB.OptionButton optAlign 
  139.          Height          =   315
  140.          Index           =   2
  141.          Left            =   375
  142.          Picture         =   "Mod1.frx":12AA
  143.          Style           =   1  'Graphical
  144.          TabIndex        =   35
  145.          ToolTipText     =   "Center"
  146.          Top             =   200
  147.          Width           =   315
  148.       End
  149.       Begin VB.OptionButton optAlign 
  150.          Height          =   315
  151.          Index           =   1
  152.          Left            =   690
  153.          Picture         =   "Mod1.frx":15EC
  154.          Style           =   1  'Graphical
  155.          TabIndex        =   34
  156.          ToolTipText     =   "Right Align"
  157.          Top             =   200
  158.          Width           =   315
  159.       End
  160.       Begin VB.CheckBox chk 
  161.          Height          =   315
  162.          Index           =   0
  163.          Left            =   1320
  164.          Picture         =   "Mod1.frx":192E
  165.          Style           =   1  'Graphical
  166.          TabIndex        =   33
  167.          ToolTipText     =   "Bullet Indent"
  168.          Top             =   510
  169.          Width           =   315
  170.       End
  171.       Begin VB.VScrollBar vsbSize 
  172.          Height          =   315
  173.          LargeChange     =   4
  174.          Left            =   1005
  175.          Max             =   2
  176.          Min             =   100
  177.          TabIndex        =   26
  178.          Top             =   825
  179.          Value           =   10
  180.          Width           =   315
  181.       End
  182.       Begin VB.CheckBox chk 
  183.          Height          =   315
  184.          Index           =   5
  185.          Left            =   1005
  186.          Picture         =   "Mod1.frx":1C70
  187.          Style           =   1  'Graphical
  188.          TabIndex        =   24
  189.          ToolTipText     =   "StrikeThru"
  190.          Top             =   510
  191.          Width           =   315
  192.       End
  193.       Begin VB.CheckBox chk 
  194.          Height          =   315
  195.          Index           =   4
  196.          Left            =   375
  197.          Picture         =   "Mod1.frx":1FB2
  198.          Style           =   1  'Graphical
  199.          TabIndex        =   22
  200.          ToolTipText     =   "Color"
  201.          Top             =   825
  202.          Width           =   315
  203.       End
  204.       Begin VB.CommandButton cmdFont 
  205.          Height          =   315
  206.          Left            =   60
  207.          Picture         =   "Mod1.frx":22F4
  208.          Style           =   1  'Graphical
  209.          TabIndex        =   23
  210.          ToolTipText     =   "Font"
  211.          Top             =   825
  212.          Width           =   315
  213.       End
  214.       Begin VB.CheckBox chk 
  215.          Height          =   315
  216.          Index           =   3
  217.          Left            =   690
  218.          Picture         =   "Mod1.frx":2636
  219.          Style           =   1  'Graphical
  220.          TabIndex        =   21
  221.          ToolTipText     =   "Underline"
  222.          Top             =   510
  223.          Width           =   315
  224.       End
  225.       Begin VB.CheckBox chk 
  226.          Height          =   315
  227.          Index           =   2
  228.          Left            =   375
  229.          Picture         =   "Mod1.frx":2978
  230.          Style           =   1  'Graphical
  231.          TabIndex        =   20
  232.          ToolTipText     =   "Italic"
  233.          Top             =   510
  234.          Width           =   315
  235.       End
  236.       Begin VB.CheckBox chk 
  237.          Height          =   315
  238.          Index           =   1
  239.          Left            =   60
  240.          Picture         =   "Mod1.frx":2CBA
  241.          Style           =   1  'Graphical
  242.          TabIndex        =   19
  243.          ToolTipText     =   "Boldface"
  244.          Top             =   510
  245.          Width           =   315
  246.       End
  247.       Begin VB.Label lblFont 
  248.          Appearance      =   0  'Flat
  249.          BackColor       =   &H80000005&
  250.          BorderStyle     =   1  'Fixed Single
  251.          ForeColor       =   &H80000008&
  252.          Height          =   315
  253.          Left            =   60
  254.          TabIndex        =   32
  255.          ToolTipText     =   "Current Font Name"
  256.          Top             =   1140
  257.          Width           =   1590
  258.       End
  259.       Begin VB.Label lblSize 
  260.          Appearance      =   0  'Flat
  261.          BackColor       =   &H80000005&
  262.          BorderStyle     =   1  'Fixed Single
  263.          Caption         =   "10"
  264.          ForeColor       =   &H80000008&
  265.          Height          =   315
  266.          Left            =   690
  267.          TabIndex        =   25
  268.          ToolTipText     =   "Text Size"
  269.          Top             =   825
  270.          Width           =   315
  271.       End
  272.    End
  273.    Begin TabDlg.SSTab tab1 
  274.       Height          =   3960
  275.       Left            =   0
  276.       TabIndex        =   11
  277.       Top             =   1500
  278.       Width           =   7440
  279.       _ExtentX        =   13123
  280.       _ExtentY        =   6985
  281.       _Version        =   327680
  282.       Tabs            =   4
  283.       TabsPerRow      =   4
  284.       TabHeight       =   520
  285.       TabCaption(0)   =   "Blank.TXT"
  286.       TabPicture(0)   =   "Mod1.frx":2FFC
  287.       Tab(0).ControlCount=   1
  288.       Tab(0).ControlEnabled=   -1  'True
  289.       Tab(0).Control(0)=   "rtb(0)"
  290.       Tab(0).Control(0).Enabled=   0   'False
  291.       TabCaption(1)   =   "Blank.TXT"
  292.       TabPicture(1)   =   "Mod1.frx":3018
  293.       Tab(1).ControlCount=   1
  294.       Tab(1).ControlEnabled=   0   'False
  295.       Tab(1).Control(0)=   "rtb(1)"
  296.       Tab(1).Control(0).Enabled=   0   'False
  297.       TabCaption(2)   =   "Blank.TXT"
  298.       TabPicture(2)   =   "Mod1.frx":3034
  299.       Tab(2).ControlCount=   1
  300.       Tab(2).ControlEnabled=   0   'False
  301.       Tab(2).Control(0)=   "rtb(2)"
  302.       Tab(2).Control(0).Enabled=   0   'False
  303.       TabCaption(3)   =   "Blank.TXT"
  304.       TabPicture(3)   =   "Mod1.frx":3050
  305.       Tab(3).ControlCount=   1
  306.       Tab(3).ControlEnabled=   0   'False
  307.       Tab(3).Control(0)=   "rtb(3)"
  308.       Tab(3).Control(0).Enabled=   0   'False
  309.       Begin RichTextLib.RichTextBox rtb 
  310.          Height          =   2340
  311.          Index           =   0
  312.          Left            =   60
  313.          TabIndex        =   0
  314.          Top             =   375
  315.          Width           =   4530
  316.          _ExtentX        =   7990
  317.          _ExtentY        =   4128
  318.          _Version        =   327680
  319.          HideSelection   =   0   'False
  320.          ScrollBars      =   3
  321.          RightMargin     =   4989
  322.          AutoVerbMenu    =   -1  'True
  323.          TextRTF         =   $"Mod1.frx":306C
  324.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  325.             Name            =   "Courier New"
  326.             Size            =   9.75
  327.             Charset         =   0
  328.             Weight          =   400
  329.             Underline       =   0   'False
  330.             Italic          =   0   'False
  331.             Strikethrough   =   0   'False
  332.          EndProperty
  333.       End
  334.       Begin RichTextLib.RichTextBox rtb 
  335.          Height          =   2340
  336.          Index           =   1
  337.          Left            =   -74985
  338.          TabIndex        =   12
  339.          Top             =   315
  340.          Width           =   4530
  341.          _ExtentX        =   7990
  342.          _ExtentY        =   4128
  343.          _Version        =   327680
  344.          HideSelection   =   0   'False
  345.          ScrollBars      =   3
  346.          RightMargin     =   4989.764
  347.          AutoVerbMenu    =   -1  'True
  348.          TextRTF         =   $"Mod1.frx":314E
  349.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  350.             Name            =   "Courier New"
  351.             Size            =   9.75
  352.             Charset         =   0
  353.             Weight          =   400
  354.             Underline       =   0   'False
  355.             Italic          =   0   'False
  356.             Strikethrough   =   0   'False
  357.          EndProperty
  358.       End
  359.       Begin RichTextLib.RichTextBox rtb 
  360.          Height          =   2340
  361.          Index           =   2
  362.          Left            =   -74970
  363.          TabIndex        =   13
  364.          Top             =   345
  365.          Width           =   4530
  366.          _ExtentX        =   7990
  367.          _ExtentY        =   4128
  368.          _Version        =   327680
  369.          HideSelection   =   0   'False
  370.          ScrollBars      =   3
  371.          RightMargin     =   4989.764
  372.          AutoVerbMenu    =   -1  'True
  373.          TextRTF         =   $"Mod1.frx":3230
  374.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  375.             Name            =   "Courier New"
  376.             Size            =   9.75
  377.             Charset         =   0
  378.             Weight          =   400
  379.             Underline       =   0   'False
  380.             Italic          =   0   'False
  381.             Strikethrough   =   0   'False
  382.          EndProperty
  383.       End
  384.       Begin RichTextLib.RichTextBox rtb 
  385.          Height          =   2340
  386.          Index           =   3
  387.          Left            =   -75000
  388.          TabIndex        =   14
  389.          Top             =   330
  390.          Width           =   4530
  391.          _ExtentX        =   7990
  392.          _ExtentY        =   4128
  393.          _Version        =   327680
  394.          HideSelection   =   0   'False
  395.          ScrollBars      =   3
  396.          RightMargin     =   4989.764
  397.          AutoVerbMenu    =   -1  'True
  398.          TextRTF         =   $"Mod1.frx":3312
  399.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  400.             Name            =   "Courier New"
  401.             Size            =   9.75
  402.             Charset         =   0
  403.             Weight          =   400
  404.             Underline       =   0   'False
  405.             Italic          =   0   'False
  406.             Strikethrough   =   0   'False
  407.          EndProperty
  408.       End
  409.    End
  410.    Begin VB.Frame fraSearch 
  411.       Caption         =   "Search and Replace"
  412.       BeginProperty Font 
  413.          Name            =   "MS Sans Serif"
  414.          Size            =   8.25
  415.          Charset         =   0
  416.          Weight          =   700
  417.          Underline       =   0   'False
  418.          Italic          =   0   'False
  419.          Strikethrough   =   0   'False
  420.       EndProperty
  421.       ForeColor       =   &H00FF0000&
  422.       Height          =   1500
  423.       Left            =   1740
  424.       TabIndex        =   3
  425.       Top             =   0
  426.       Width           =   6450
  427.       Begin VB.Frame fraS 
  428.          Caption         =   "Search"
  429.          BeginProperty Font 
  430.             Name            =   "MS Sans Serif"
  431.             Size            =   8.25
  432.             Charset         =   0
  433.             Weight          =   700
  434.             Underline       =   0   'False
  435.             Italic          =   0   'False
  436.             Strikethrough   =   0   'False
  437.          EndProperty
  438.          ForeColor       =   &H00C00000&
  439.          Height          =   540
  440.          Left            =   60
  441.          TabIndex        =   15
  442.          Top             =   915
  443.          Width           =   3210
  444.          Begin VB.OptionButton opt 
  445.             Caption         =   "All Text"
  446.             Height          =   285
  447.             Index           =   1
  448.             Left            =   1845
  449.             TabIndex        =   17
  450.             Top             =   195
  451.             Width           =   1035
  452.          End
  453.          Begin VB.OptionButton opt 
  454.             Caption         =   "Current Text Box"
  455.             Height          =   285
  456.             Index           =   0
  457.             Left            =   60
  458.             TabIndex        =   16
  459.             Top             =   195
  460.             Value           =   -1  'True
  461.             Width           =   1560
  462.          End
  463.       End
  464.       Begin VB.CommandButton cmdNext 
  465.          Caption         =   "Find Again"
  466.          Height          =   315
  467.          Left            =   3915
  468.          TabIndex        =   8
  469.          Top             =   225
  470.          Width           =   1230
  471.       End
  472.       Begin VB.CommandButton cmdR 
  473.          Caption         =   "Replace"
  474.          Enabled         =   0   'False
  475.          Height          =   315
  476.          Left            =   3915
  477.          TabIndex        =   7
  478.          Top             =   600
  479.          Width           =   1230
  480.       End
  481.       Begin VB.CommandButton cmdRAll 
  482.          Caption         =   "Replace All"
  483.          Enabled         =   0   'False
  484.          Height          =   315
  485.          Left            =   5160
  486.          TabIndex        =   6
  487.          Top             =   600
  488.          Width           =   1230
  489.       End
  490.       Begin VB.CheckBox chk1 
  491.          Caption         =   "Case sensitive"
  492.          Height          =   240
  493.          Left            =   3915
  494.          TabIndex        =   5
  495.          Top             =   975
  496.          Width           =   2040
  497.       End
  498.       Begin VB.CheckBox chk2 
  499.          Caption         =   "Whole word only"
  500.          Height          =   240
  501.          Left            =   3915
  502.          TabIndex        =   4
  503.          Top             =   1215
  504.          Width           =   2040
  505.       End
  506.       Begin VB.TextBox txtF 
  507.          BeginProperty Font 
  508.             Name            =   "Courier New"
  509.             Size            =   9
  510.             Charset         =   0
  511.             Weight          =   400
  512.             Underline       =   0   'False
  513.             Italic          =   0   'False
  514.             Strikethrough   =   0   'False
  515.          EndProperty
  516.          Height          =   285
  517.          Left            =   1725
  518.          TabIndex        =   1
  519.          Top             =   225
  520.          Width           =   2115
  521.       End
  522.       Begin VB.TextBox txtR 
  523.          BeginProperty Font 
  524.             Name            =   "Courier New"
  525.             Size            =   9
  526.             Charset         =   0
  527.             Weight          =   400
  528.             Underline       =   0   'False
  529.             Italic          =   0   'False
  530.             Strikethrough   =   0   'False
  531.          EndProperty
  532.          Height          =   285
  533.          Left            =   1725
  534.          TabIndex        =   2
  535.          Top             =   600
  536.          Width           =   2115
  537.       End
  538.       Begin VB.Label lbl1 
  539.          BorderStyle     =   1  'Fixed Single
  540.          Caption         =   " Find what"
  541.          BeginProperty Font 
  542.             Name            =   "MS Sans Serif"
  543.             Size            =   9.75
  544.             Charset         =   0
  545.             Weight          =   700
  546.             Underline       =   0   'False
  547.             Italic          =   0   'False
  548.             Strikethrough   =   0   'False
  549.          EndProperty
  550.          Height          =   360
  551.          Left            =   60
  552.          TabIndex        =   10
  553.          Top             =   180
  554.          Width           =   3825
  555.       End
  556.       Begin VB.Label lbl2 
  557.          BorderStyle     =   1  'Fixed Single
  558.          Caption         =   " Replace with"
  559.          BeginProperty Font 
  560.             Name            =   "MS Sans Serif"
  561.             Size            =   9.75
  562.             Charset         =   0
  563.             Weight          =   700
  564.             Underline       =   0   'False
  565.             Italic          =   0   'False
  566.             Strikethrough   =   0   'False
  567.          EndProperty
  568.          Height          =   360
  569.          Left            =   60
  570.          TabIndex        =   9
  571.          Top             =   555
  572.          Width           =   3825
  573.       End
  574.    End
  575.    Begin MSComDlg.CommonDialog cd1 
  576.       Left            =   105
  577.       Top             =   0
  578.       _ExtentX        =   847
  579.       _ExtentY        =   847
  580.       _Version        =   327680
  581.       FontSize        =   1.17491e-38
  582.    End
  583.    Begin VB.Menu mnuFile 
  584.       Caption         =   "&File"
  585.       Begin VB.Menu mnuNew 
  586.          Caption         =   "&New"
  587.       End
  588.       Begin VB.Menu mnuOpen 
  589.          Caption         =   "&Open"
  590.       End
  591.       Begin VB.Menu mnuReOpen 
  592.          Caption         =   "&ReOpen"
  593.          Enabled         =   0   'False
  594.       End
  595.       Begin VB.Menu mnuRename 
  596.          Caption         =   "ReNa&me"
  597.       End
  598.       Begin VB.Menu mnu3 
  599.          Caption         =   "-"
  600.       End
  601.       Begin VB.Menu mnuSave 
  602.          Caption         =   "&Save"
  603.       End
  604.       Begin VB.Menu mnuSaveAs 
  605.          Caption         =   "Save &As"
  606.       End
  607.       Begin VB.Menu mnu4 
  608.          Caption         =   "-"
  609.       End
  610.       Begin VB.Menu mnuPrintSelected 
  611.          Caption         =   "Print Selected &Text"
  612.          Enabled         =   0   'False
  613.       End
  614.       Begin VB.Menu mnuPrint 
  615.          Caption         =   "&Print Current Text Box"
  616.       End
  617.       Begin VB.Menu mnu5 
  618.          Caption         =   "-"
  619.       End
  620.       Begin VB.Menu mnuExit 
  621.          Caption         =   "E&xit"
  622.       End
  623.    End
  624.    Begin VB.Menu mnuEdit 
  625.       Caption         =   "&Edit"
  626.       Begin VB.Menu mnuClear 
  627.          Caption         =   "Clea&r"
  628.       End
  629.       Begin VB.Menu mnuClearAll 
  630.          Caption         =   "Clear &All"
  631.       End
  632.       Begin VB.Menu mnu1 
  633.          Caption         =   "-"
  634.       End
  635.       Begin VB.Menu mnuCopy 
  636.          Caption         =   "Co&py"
  637.          Enabled         =   0   'False
  638.       End
  639.       Begin VB.Menu mnuCut 
  640.          Caption         =   "Cu&t"
  641.          Enabled         =   0   'False
  642.       End
  643.       Begin VB.Menu mnuPaste 
  644.          Caption         =   "&Paste"
  645.       End
  646.       Begin VB.Menu mnuDelete 
  647.          Caption         =   "&Delete"
  648.          Enabled         =   0   'False
  649.       End
  650.       Begin VB.Menu mnu2 
  651.          Caption         =   "-"
  652.       End
  653.       Begin VB.Menu mnuSelect 
  654.          Caption         =   "&Select All"
  655.       End
  656.    End
  657.    Begin VB.Menu mnuHelp 
  658.       Caption         =   "&Help"
  659.       Begin VB.Menu mnuAbout 
  660.          Caption         =   "&About"
  661.       End
  662.    End
  663. Attribute VB_Name = "frm1"
  664. Attribute VB_GlobalNameSpace = False
  665. Attribute VB_Creatable = False
  666. Attribute VB_PredeclaredId = True
  667. Attribute VB_Exposed = False
  668. Const Filt = "Text  (*.TXT)|*.TXT|Rich Text  (*.RTF)|*.RTF|All Files  (*.*)|*.*"
  669. Dim Pos(3) As Integer
  670. Dim OpenFile(3) As String, SavedAs(3) As Boolean
  671. Dim FindFlags As Integer
  672. Dim FName As String, ReplaceYes As Boolean
  673. Private Sub chk_Click(Index As Integer)
  674. On Error Resume Next
  675. Select Case Index
  676. Case 0  'bullet
  677.   rtb(tab1.Tab).SelBullet = chk(0).Value
  678. Case 1  'Bold
  679.   rtb(tab1.Tab).SelBold = chk(1).Value
  680. Case 2  'Italic
  681.   rtb(tab1.Tab).SelItalic = chk(2).Value
  682. Case 3  'Underline
  683.   rtb(tab1.Tab).SelUnderline = chk(3).Value
  684. Case 4  'Color
  685.   If chk(4).Value = 1 Then
  686.     cd1.ShowColor
  687.     rtb(tab1.Tab).SelColor = cd1.Color
  688.   Else
  689.     cd1.Color = vbBlack
  690.     rtb(tab1.Tab).SelColor = cd1.Color
  691.   End If
  692. Case 5  'StrikeThru
  693.   rtb(tab1.Tab).SelStrikeThru = chk(5).Value
  694. End Select
  695. End Sub
  696. Private Sub cmdCase_Click(Index As Integer)
  697. If Index = 0 Then      'UPPERCASE
  698.   rtb(tab1.Tab).SelText = UCase(rtb(tab1.Tab).SelText)
  699. ElseIf Index = 1 Then  'lowercase
  700.   rtb(tab1.Tab).SelText = LCase(rtb(tab1.Tab).SelText)
  701. End If
  702. rtb(tab1.Tab).SetFocus
  703. End Sub
  704. Private Sub cmdClear_Click()
  705. mnuNew_Click
  706. End Sub
  707. Private Sub cmdFont_Click()
  708. On Error Resume Next
  709. 'Finds 7 Properties
  710. cd1.FontItalic = rtb(tab1.Tab).SelItalic
  711. cd1.FontBold = rtb(tab1.Tab).SelBold
  712. cd1.FontName = FName
  713. cd1.FontSize = rtb(tab1.Tab).SelFontSize
  714. cd1.FontStrikethru = rtb(tab1.Tab).SelStrikeThru
  715. cd1.FontUnderline = rtb(tab1.Tab).SelUnderline
  716. cd1.Color = rtb(tab1.Tab).SelColor
  717. 'Sets Flags and Shows FontSelect
  718. cd1.Flags = cdlCFBoth Or cdlCFEffects Or 262144
  719. cd1.ShowFont
  720. 'Returns 7 Properties
  721. AdjustButtons
  722. FName = cd1.FontName
  723. lblFont.Caption = FName
  724. vsbSize.Value = cd1.FontSize
  725. rtb(tab1.Tab).SelColor = cd1.Color
  726. End Sub
  727. Private Sub cmdOK_Click(Index As Integer)
  728. If Index = 0 Then 'OK
  729.   Select Case fraNew.Caption
  730.   Case "Create New File"
  731.     tab1.Caption = txtNew.Text & "." & cboNew.Text
  732.     OpenFile(tab1.Tab) = tab1.Caption
  733.     rtb(tab1.Tab).Text = ""
  734.     SavedAs(tab1.Tab) = False
  735.   Case "Rename " To "Rename z"
  736.     tab1.Caption = txtNew.Text & "." & cboNew.Text
  737.     OpenFile(tab1.Tab) = tab1.Caption
  738.   End Select
  739.   Me.Caption = "MultiDoc     " & OpenFile(tab1.Tab)
  740. End If
  741. fraNew.Visible = False
  742. End Sub
  743. Private Sub mnuCopy_Click()
  744. Clipboard.Clear
  745. Clipboard.SetText rtb(tab1.Tab).SelText
  746. End Sub
  747. Private Sub mnuCut_Click()
  748. Clipboard.Clear
  749. Clipboard.SetText rtb(tab1.Tab).SelText
  750. rtb(tab1.Tab).SelText = ""
  751. End Sub
  752. Private Sub mnuFile_Click()
  753. mnuReOpen.Enabled = SavedAs(tab1.Tab)
  754. mnuReOpen.Caption = "&Re-Open " & tab1.Caption
  755. mnuSave.Enabled = SavedAs(tab1.Tab)
  756. mnuSave.Caption = "&Save " & tab1.Caption
  757. mnuRename.Caption = "Rena&me " & tab1.Caption
  758. End Sub
  759. Private Sub mnuNew_Click()
  760. fraNew.Visible = True
  761. End Sub
  762. Private Sub mnuPaste_Click()
  763. rtb(tab1.Tab).SelText = Clipboard.GetText()
  764. End Sub
  765. Private Sub mnuPrintSelected_Click()
  766. Printer.Print rtb(tab1.Tab).SelText
  767. Printer.EndDoc
  768. End Sub
  769. Private Sub mnuRename_Click()
  770. fraNew.Caption = "Rename " & tab1.Caption
  771. fraNew.Visible = True
  772. txtNew.ToolTipText = "FileName"
  773. cboNew.ToolTipText = "Extension"
  774. End Sub
  775. Private Sub mnuReOpen_Click()
  776. On Error GoTo FileError:
  777. ResetButtons
  778. 'Adjusts For File Types
  779. If UCase(Right(OpenFile(tab1.Tab), 3)) = "RTF" Then
  780.   tmode = rtfRTF
  781.   tmode = rtfText
  782. End If
  783. rtb(tab1.Tab).LoadFile OpenFile(tab1.Tab), tmode
  784. SavedAs(tab1.Tab) = True
  785. Exit Sub
  786. FileError:
  787. If Err.Number = cdlCancel Then Exit Sub
  788. MsgBox "Unkown error while opening file " & cd1.filename
  789. OpenFile(tab1.Tab) = "Blank.TXT"
  790. End Sub
  791. Private Sub mnuSave_Click()
  792. Dim Extension As String
  793. Extension = UCase(Right(tab1.Caption, 3))
  794. 'This Adjusts Automatically for Saving Files
  795. If Extension = "RTF" Then
  796.   rtb(tab1.Tab).SaveFile OpenFile(tab1.Tab), rtfRTF
  797.   rtb(tab1.Tab).SaveFile OpenFile(tab1.Tab), rtfText
  798. End If
  799. End Sub
  800. Private Sub mnuSelect_Click()
  801. rtb(tab1.Tab).SelStart = 0
  802. rtb(tab1.Tab).SelLength = Len(rtb(tab1.Tab).Text)
  803. End Sub
  804. Private Sub mnuExit_Click()
  805. End Sub
  806. Private Sub mnuOpen_Click()
  807. On Error GoTo FileError:
  808. cd1.CancelError = True
  809. cd1.Flags = cdlOFNFileMustExist
  810. cd1.Filter = Filt
  811. cd1.ShowOpen
  812. ResetButtons
  813. 'Adjusts For File Types
  814. If UCase(Right(cd1.filename, 3)) = "RTF" Then
  815.   tmode = rtfRTF
  816.   tmode = rtfText
  817. End If
  818. rtb(tab1.Tab).LoadFile cd1.filename, tmode
  819. OpenFile(tab1.Tab) = cd1.filename
  820. tab1.Caption = cd1.FileTitle
  821. SavedAs(tab1.Tab) = True
  822. Me.Caption = "MultiDoc     " & OpenFile(tab1.Tab)
  823. Exit Sub
  824. FileError:
  825. If Err.Number = cdlCancel Then Exit Sub
  826. MsgBox "Unkown error while opening file " & cd1.filename
  827. OpenFile(tab1.Tab) = "Blank.TXT"
  828. End Sub
  829. Private Sub mnuSaveAs_Click()
  830. Dim Extension As String
  831. Extension = UCase(Right(tab1.Caption, 3))
  832. On Error GoTo FileError:
  833. 'Auto Sets Extension
  834. Select Case Extension
  835. Case "TXT"
  836.   cd1.FilterIndex = 1
  837. Case "RTF"
  838.   cd1.FilterIndex = 2
  839. Case Else
  840.   cd1.FilterIndex = 3
  841. End Select
  842. cd1.CancelError = True
  843. cd1.filename = OpenFile(tab1.Tab)
  844. cd1.Filter = Filt
  845. cd1.ShowSave
  846. 'This Adjusts Automatically for Saving Files
  847. If Extension = "RTF" Then
  848.   rtb(tab1.Tab).SaveFile cd1.filename, rtfRTF
  849.   rtb(tab1.Tab).SaveFile cd1.filename, rtfText
  850. End If
  851. OpenFile(tab1.Tab) = cd1.filename
  852. tab1.Caption = cd1.FileTitle
  853. SavedAs(tab1.Tab) = True
  854. Me.Caption = "MultiDoc     " & OpenFile(tab1.Tab)
  855. Exit Sub
  856. FileError:
  857. If Err.Number = cdlCancel Then Exit Sub
  858. MsgBox "Unkown error while opening file " & cd1.filename
  859. OpenFile(tab1.Tab) = "Blank.TXT"
  860. End Sub
  861. Private Sub Form_Load()
  862. Dim i As Integer
  863. SizeMe
  864. For i = 0 To 3
  865.   Pos(i) = -1
  866.   OpenFile(i) = "Blank.TXT"
  867. FName = txtF.FontName
  868. lblFont.Caption = FName
  869. If Command$ <> "" Then
  870.   'Adjusts For File Types
  871.   If UCase(Right(Command$, 3)) = "RTF" Then
  872.     tmode = rtfRTF
  873.   Else
  874.     tmode = rtfText
  875.   End If
  876.   rtb(tab1.Tab).LoadFile Command$, tmode
  877.   OpenFile(tab1.Tab) = Command$
  878.   tab1.Caption = ExtractText(Command$, "\", False, False)
  879.   SavedAs(tab1.Tab) = True
  880.   Me.Caption = "MultiDoc     " & OpenFile(tab1.Tab)
  881. End If
  882. End Sub
  883. Private Sub Form_Resize()
  884. SizeMe
  885. End Sub
  886. Private Sub cmdNext_Click()
  887. On Error Resume Next
  888. SearchMe
  889. 'Found Something
  890. If Pos(tab1.Tab) >= 0 Then
  891.   cmdR.Enabled = True
  892.   cmdRAll.Enabled = True
  893. 'Didn't Find
  894.   MsgBox "String not found"
  895.   cmdR.Enabled = False
  896.   cmdRAll.Enabled = False
  897. End If
  898. End Sub
  899. Private Sub mnuAbout_Click()
  900. MsgBox App.EXEName & " by Todd Spangler"
  901. End Sub
  902. Private Sub mnuClear_Click()
  903. rtb(tab1.Tab).Text = ""
  904. End Sub
  905. Private Sub mnuClearAll_Click()
  906. Dim i As Integer
  907. For i = 0 To 3
  908.   rtb(i).Text = ""
  909. End Sub
  910. Private Sub mnuDelete_Click()
  911. rtb(tab1.Tab).SelText = ""
  912. End Sub
  913. Private Sub mnuPrint_Click()
  914. Printer.Print rtb(tab1.Tab).Text
  915. Printer.EndDoc
  916. End Sub
  917. Private Sub optAlign_Click(Index As Integer)
  918. rtb(tab1.Tab).SelAlignment = Index
  919. End Sub
  920. Private Sub cmdR_Click()
  921. On Error Resume Next
  922. 'Searches & Replaces
  923. rtb(tab1.Tab).SelText = txtR.Text
  924. SearchMe
  925. 'Found Something
  926. If Pos(tab1.Tab) >= 0 Then
  927.   'Didn't Find
  928.   MsgBox "String not found"
  929.   cmdR.Enabled = False
  930.   cmdRAll.Enabled = False
  931. End If
  932. End Sub
  933. Private Sub cmdRAll_MouseDown(Button As Integer, Shift As Integer, X As Single, y As Single)
  934. BetterFind (txtF.Text)
  935. If ReplaceYes Then
  936.   ReplaceAll
  937. End If
  938. End Sub
  939. Public Sub SizeMe()
  940. Dim i As Integer
  941. On Error Resume Next
  942. For i = 0 To 3
  943.   rtb(i).RightMargin = rtb(i).Width - 100
  944.   rtb(i).Left = 60
  945.   rtb(i).Top = 375
  946.   tab1.Height = Me.ScaleHeight - fraSearch.Height
  947.   tab1.Width = Me.ScaleWidth
  948.   rtb(i).Width = tab1.Width - 120
  949.   rtb(i).Height = tab1.Height - 450
  950.   rtb(i).RightMargin = rtb(i).Width - 100
  951. End Sub
  952. Private Sub rtb_Change(Index As Integer)
  953. 'Bullet Indent 0
  954. rtb(tab1.Tab).SelBullet = chk(0).Value
  955. 'Bold 1
  956. rtb(tab1.Tab).SelBold = chk(1).Value
  957. 'Italic 2
  958. rtb(tab1.Tab).SelItalic = chk(2).Value
  959. 'Underline 3
  960. rtb(tab1.Tab).SelUnderline = chk(3).Value
  961. 'Color 4
  962. rtb(tab1.Tab).SelColor = cd1.Color
  963. 'StrikeThru
  964. rtb(tab1.Tab).SelStrikeThru = chk(5).Value
  965. 'Size
  966. rtb(tab1.Tab).SelFontSize = vsbSize.Value
  967. 'Font Name
  968. rtb(tab1.Tab).SelFontName = FName
  969. End Sub
  970. Private Sub rtb_KeyUp(Index As Integer, KeyCode As Integer, Shift As Integer)
  971. 'Select word, or sentence
  972. If Shift = vbCtrlMask Then
  973.   Select Case KeyCode
  974.   'If Ctrl+S:
  975.   Case vbKeyS
  976.     rtb(tab1.Tab).Span ".?!", False, True
  977.     SelectionStart = rtb(tab1.Tab).SelStart
  978.     'Select to the end of the sentence.
  979.     rtb(tab1.Tab).Span ".?!", True, True
  980.     'Extend selection to include punctuation.
  981.     SelectionEnd = rtb(tab1.Tab).SelStart + rtb(tab1.Tab).SelLength
  982.     rtb(tab1.Tab).SelStart = SelectionStart
  983.     rtb(tab1.Tab).SelLength = SelectionEnd - SelectionStart
  984.     'If Ctrl+W:
  985.   Case vbKeyW
  986.     'Select to the end of the word.
  987.     rtb(tab1.Tab).Span " ,;:.?!", False, True
  988.     SelectionStart = rtb(tab1.Tab).SelStart
  989.     'Select to the end of the word
  990.     rtb(tab1.Tab).Span " ,;:.?!", True, True
  991.     SelectionEnd = rtb(tab1.Tab).SelStart + rtb(tab1.Tab).SelLength
  992.     rtb(tab1.Tab).SelStart = SelectionStart
  993.     rtb(tab1.Tab).SelLength = SelectionEnd - SelectionStart
  994.   End Select
  995. End If
  996. 'Move pointer by word or sentence
  997. If Shift = (vbCtrlMask Or vbShiftMask) Then
  998.   Select Case KeyCode
  999.   Case vbKeyS
  1000.     'Move pointer to end of sentence.
  1001.     rtb(tab1.Tab).UpTo ".?!", True, False
  1002.   Case vbKeyW
  1003.     'Move pointer to end of word.
  1004.     rtb(tab1.Tab).UpTo " ,;:.?!", True, False
  1005.   End Select
  1006. End If
  1007. End Sub
  1008. Public Sub SearchMe()
  1009. FindFlags = chk1.Value * 4 + chk2.Value * 2
  1010. On Error Resume Next
  1011. 'Current Text Box
  1012. If opt(0).Value Then
  1013.   Pos(tab1.Tab) = rtb(tab1.Tab).Find(txtF.Text, Pos(tab1.Tab) + 1, , FindFlags)
  1014.   'All Text
  1015. ElseIf opt(1).Value Then
  1016.   Pos(tab1.Tab) = rtb(tab1.Tab).Find(txtF.Text, Pos(tab1.Tab) + 1, , FindFlags)
  1017.   If tab1.Tab < 3 Then
  1018.     'Found Something
  1019.     If Pos(tab1.Tab) >= 0 Then
  1020.     'Didn't Find
  1021.     Else
  1022.       Do Until tab1.Tab = 3 Or Pos(tab1.Tab) >= 0
  1023.         tab1.Tab = tab1.Tab + 1
  1024.         Pos(tab1.Tab) = rtb(tab1.Tab).Find(txtF.Text, Pos(tab1.Tab) + 1, , FindFlags)
  1025.       Loop
  1026.     End If
  1027.   End If
  1028. End If
  1029. End Sub
  1030. Private Sub rtb_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, y As Single)
  1031. rtb(tab1.Tab).SetFocus
  1032. If rtb(tab1.Tab).SelLength > 0 Then
  1033.   cmdCase(0).Enabled = True
  1034.   cmdCase(1).Enabled = True
  1035.   mnuCopy.Enabled = True
  1036.   mnuCut.Enabled = True
  1037.   mnuDelete.Enabled = True
  1038.   mnuPrintSelected.Enabled = True
  1039.   cmdCase(0).Enabled = False
  1040.   cmdCase(1).Enabled = False
  1041.   mnuCopy.Enabled = False
  1042.   mnuCut.Enabled = False
  1043.   mnuDelete.Enabled = False
  1044.   mnuPrintSelected.Enabled = False
  1045. End If
  1046. End Sub
  1047. Private Sub rtb_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, y As Single)
  1048. Dim i As Integer
  1049. On Error Resume Next
  1050. 'Fixes bug
  1051. For i = 0 To 3
  1052.   Pos(i) = 0
  1053. Pos(tab1.Tab) = rtb(tab1.Tab).SelStart
  1054. End Sub
  1055. Private Sub tab1_Click(PreviousTab As Integer)
  1056. Dim i As Integer
  1057. 'Fixes bug
  1058. For i = 0 To 3
  1059.   Pos(i) = -1
  1060. Me.Caption = "MultiDoc     " & OpenFile(tab1.Tab)
  1061. End Sub
  1062. Public Sub AdjustButtons()
  1063. Dim i(3) As Boolean, z As Integer
  1064. Dim a(3) As Integer
  1065. i(0) = cd1.FontBold
  1066. i(1) = cd1.FontItalic
  1067. i(2) = cd1.FontUnderline
  1068. i(3) = cd1.FontStrikethru
  1069. For z = 0 To 3
  1070.   If i(z) Then
  1071.     a(z) = 1
  1072.   ElseIf i(z) = False Then
  1073.     a(z) = 0
  1074.   End If
  1075. 'Bold
  1076. chk(1).Value = a(0)
  1077. 'Italic 2
  1078. chk(2).Value = a(1)
  1079. 'Underline 3
  1080. chk(3).Value = a(2)
  1081. 'StrikeThru 5
  1082. chk(5).Value = a(3)
  1083. End Sub
  1084. Private Sub vsbSize_Change()
  1085. lblSize.Caption = vsbSize.Value
  1086. rtb(tab1.Tab).SetFocus
  1087. End Sub
  1088. Private Sub vsbSize_Scroll()
  1089. lblSize.Caption = vsbSize.Value
  1090. rtb(tab1.Tab).SetFocus
  1091. End Sub
  1092. Public Sub ResetButtons()
  1093. 'Size
  1094. vsbSize.Value = 10
  1095. 'Left Align
  1096. optAlign(0).Value = True
  1097. 'Bullet
  1098. chk(0).Value = 0
  1099. 'Bold
  1100. chk(1).Value = 0
  1101. 'Italic 2
  1102. chk(2).Value = 0
  1103. 'Underline 3
  1104. chk(3).Value = 0
  1105. 'StrikeThru 5
  1106. chk(5).Value = 0
  1107. 'Color
  1108. chk(4).Value = 0
  1109. 'Font Name
  1110. FName = txtF.FontName
  1111. rtb(tab1.Tab).SelFontName = FName
  1112. lblFont.Caption = FName
  1113. End Sub
  1114. Public Sub BetterFind(FindText As String)
  1115. 'Finds Text Correctly!!!!!
  1116. ReplaceYes = True
  1117. Dim X, y, z
  1118. big$ = rtb(tab1.Tab).Text
  1119. target$ = FindText
  1120.   X = y + 1
  1121.   z = z + 1
  1122.   y = InStr(X, big$, target$)
  1123. Loop Until y = 0
  1124. If MsgBox(target$ & " was found " & z - 1 & " times.  Replace All?", vbQuestion + 1, "Replace All?") = vbCancel Then
  1125.   ReplaceYes = False
  1126. End If
  1127. End Sub
  1128. Public Sub ReplaceAll()
  1129. On Error Resume Next
  1130. OpenFix = True
  1131. 'Searches & Replaces
  1132. rtb(tab1.Tab).SelText = txtR.Text
  1133. SearchMe
  1134. 'Found Something
  1135. If Pos(tab1.Tab) >= 0 Then
  1136.   ReplaceAll
  1137. 'Didn't Find
  1138.   MsgBox "String not found"
  1139.   cmdR.Enabled = False
  1140.   cmdRAll.Enabled = False
  1141. End If
  1142. OpenFix = False
  1143. End Sub
  1144. 'Extracts Text using a token or character
  1145. Public Function ExtractText(FullText As String, token As String, Optional StartAtLeft = True, Optional IncludeLeftSide = True) As String
  1146. Dim i As Integer
  1147. If StartAtLeft And IncludeLeftSide Then
  1148.   ExtractText = FullText
  1149.   For i = 1 To Len(FullText)
  1150.     If Mid(FullText, i, 1) = token Then
  1151.       ExtractText = Left(FullText, i - 1)
  1152.       Exit Function
  1153.     End If
  1154.   Next
  1155. ElseIf StartAtLeft And IncludeLeftSide = False Then
  1156.   ExtractText = FullText
  1157.   For i = 1 To Len(FullText)
  1158.     If Mid(FullText, i, 1) = token Then
  1159.       ExtractText = Right(FullText, Len(FullText) - i)
  1160.       Exit Function
  1161.     End If
  1162.   Next
  1163. ElseIf StartAtLeft = False And IncludeLeftSide Then
  1164.   ExtractText = ""
  1165.   For i = Len(FullText) To 1 Step -1
  1166.     If Mid(FullText, i, 1) = token Then
  1167.       ExtractText = Left(FullText, i - 1)
  1168.       Exit Function
  1169.     End If
  1170.   Next
  1171. ElseIf StartAtLeft = False And IncludeLeftSide = False Then
  1172.   ExtractText = ""
  1173.   For i = Len(FullText) To 1 Step -1
  1174.     If Mid(FullText, i, 1) = token Then
  1175.       ExtractText = Right(FullText, Len(FullText) - i)
  1176.       Exit Function
  1177.     End If
  1178.   Next
  1179. End If
  1180. End Function
  1181.