VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
Begin VB.Form frmMDIChild 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   630
   ClientWidth     =   5325
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   3195
   ScaleWidth      =   5325
   WindowState     =   2  'Maximized
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   2160
      Top             =   600
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin RichTextLib.RichTextBox RichTextBox1 
      Height          =   3255
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   5295
      _ExtentX        =   9340
      _ExtentY        =   5741
      _Version        =   393217
      ScrollBars      =   2
      TextRTF         =   $"v6bj08-09b.frx":0000
   End
   Begin VB.Menu mnuFile 
      Caption         =   "文件(&F)"
      Begin VB.Menu mnuNew 
         Caption         =   "新建"
      End
      Begin VB.Menu mnuOpen 
         Caption         =   "打开"
      End
      Begin VB.Menu mnuSave 
         Caption         =   "保存"
      End
      Begin VB.Menu mnuSaveAs 
         Caption         =   "另存为"
      End
      Begin VB.Menu mnuClose 
         Caption         =   "关闭"
      End
   End
   Begin VB.Menu mnuEdit 
      Caption         =   "编辑(&E)"
      Begin VB.Menu mnuCopy 
         Caption         =   "复制"
         Shortcut        =   ^C
      End
      Begin VB.Menu mnuPaste 
         Caption         =   "粘贴"
      End
      Begin VB.Menu mnuCut 
         Caption         =   "剪切"
      End
      Begin VB.Menu sp 
         Caption         =   "-"
      End
      Begin VB.Menu mnuSearch 
         Caption         =   "查找..."
      End
   End
   Begin VB.Menu mnuFormat 
      Caption         =   "格式化(&O)"
      Begin VB.Menu mnuFont 
         Caption         =   "字体"
      End
      Begin VB.Menu mnuDl 
         Caption         =   "段落"
      End
   End
   Begin VB.Menu mnuOption 
      Caption         =   "选项(&P)"
      Begin VB.Menu mnuStatus 
         Caption         =   "状态栏"
         Checked         =   -1  'True
      End
      Begin VB.Menu mnuPicture 
         Caption         =   "插入图片"
      End
   End
   Begin VB.Menu win 
      Caption         =   "窗口(&W)"
      WindowList      =   -1  'True
      Begin VB.Menu mnuTile 
         Caption         =   "平铺"
      End
      Begin VB.Menu mnuCascade 
         Caption         =   "层叠"
      End
      Begin VB.Menu mnuIcon 
         Caption         =   "排列图标"
      End
   End
End
Attribute VB_Name = "frmMDIChild"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim boolDirty As Boolean

Private Sub Form_Resize()
   Me.RichTextBox1.Width = Me.Width
   Me.RichTextBox1.Height = Me.Height
End Sub

Private Sub mnuSearch_Click()
    If Me.RichTextBox1.SelText <> "" Then
        frmFind.Text1.Text = frmMDI.ActiveForm.RichTextBox1.SelText
        frmFind.Show vbModal
    Else
        MsgBox "必须选中欲查找的内容"
        Exit Sub
    End If
 End Sub
Private Sub mnuIcon_Click()
  frmMDI.Arrange vbArrangeIcons
End Sub

Private Sub mnuTile_Click()
  frmMDI.Arrange vbTileHorizontal
End Sub
Private Sub mnuCascade_Click()
  frmMDI.Arrange vbCascade
End Sub
Private Sub mnuCut_Click()
  CutProc
End Sub
Private Sub mnuCopy_Click()
  CopyProc
End Sub

Private Sub mnuPaste_Click()
  PasteProc
End Sub

Private Sub mnuClose_Click()
  If boolDirty Then
    fsave
  End If
  Unload Me
End Sub

Private Sub mnuFont_Click()
   With frmMDI.ActiveForm.CommonDialog1
     .Flags = cdlCFBoth + cdlCFEffects
      .FontSize = RichTextBox1.SelFontSize
     .Action = 4
   End With
   With frmMDI.ActiveForm.RichTextBox1
     .SelFontName = CommonDialog1.FontName
     .SelFontSize = CommonDialog1.FontSize
     .SelBold = CommonDialog1.FontBold
     .SelItalic = CommonDialog1.FontItalic
     .SelUnderline = CommonDialog1.FontUnderline
     .SelStrikeThru = CommonDialog1.FontStrikethru
  End With
End Sub

Private Sub mnuNew_Click()
   FileNew
End Sub

Private Sub cd_Click()
  frmMDI.Arrange vbCascade
End Sub

Private Sub mnuOpen_Click()
   FileOpen
End Sub

Private Sub mnuPicture_Click()
    With frmMDI.ActiveForm.CommonDialog1
     .Filter = "*.bmp|*.bmp|*.ico|*.ico"
     .Action = 1
   End With
   frmMDI.ActiveForm.RichTextBox1.OLEObjects.Add , , frmMDI.ActiveForm.CommonDialog1.FileName
End Sub

Private Sub mnuSave_Click()
  fsave
End Sub

Private Sub pp_Click()
  frmMDI.Arrange vbTileHorizontal
End Sub

Private Sub mtb_Click()
  frmMDI.Arrange vbArrangeIcons
End Sub

Private Sub mnuStatus_Click()
   If mnuStatus.Checked Then
       frmMDI.StatusBar1.Visible = 0
       mnuStatus.Checked = 0
    Else
       frmMDI.StatusBar1.Visible = 1
       mnuStatus.Checked = 1
    End If
End Sub

Private Sub RichTextBox1_Change()
'  frmMDI.StatusBar1.Panels(2).Text = RichTextBox1.SelStart
  boolDirty = True
End Sub

