VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3165
   ClientLeft      =   2670
   ClientTop       =   3135
   ClientWidth     =   5190
   LinkTopic       =   "Form1"
   ScaleHeight     =   3165
   ScaleWidth      =   5190
   Begin MSComctlLib.StatusBar StatusBar1 
      Align           =   2  'Align Bottom
      Height          =   435
      Left            =   0
      TabIndex        =   2
      Top             =   2730
      Width           =   5190
      _ExtentX        =   9155
      _ExtentY        =   767
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   2
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   5
            Picture         =   "sy08-07.frx":0000
            TextSave        =   "18:18"
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   2040
      Top             =   840
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   5
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "sy08-07.frx":019A
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "sy08-07.frx":02AC
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "sy08-07.frx":03BE
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "sy08-07.frx":04D0
            Key             =   ""
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "sy08-07.frx":05E2
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.Toolbar Toolbar1 
      Align           =   1  'Align Top
      Height          =   360
      Left            =   0
      TabIndex        =   1
      Top             =   0
      Width           =   5190
      _ExtentX        =   9155
      _ExtentY        =   635
      ButtonWidth     =   609
      ButtonHeight    =   582
      Appearance      =   1
      Style           =   1
      ImageList       =   "ImageList1"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   7
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "mfind"
            ImageIndex      =   1
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "mdel"
            ImageIndex      =   2
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "msp"
            Style           =   3
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "mfont"
            ImageIndex      =   3
            Style           =   5
            BeginProperty ButtonMenus {66833FEC-8583-11D1-B16A-00C0F0283628} 
               NumButtonMenus  =   2
               BeginProperty ButtonMenu1 {66833FEE-8583-11D1-B16A-00C0F0283628} 
                  Key             =   "m12"
                  Text            =   "12号"
               EndProperty
               BeginProperty ButtonMenu2 {66833FEE-8583-11D1-B16A-00C0F0283628} 
                  Key             =   "m16"
                  Text            =   "16号"
               EndProperty
            EndProperty
         EndProperty
         BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "msp1"
            Style           =   3
         EndProperty
         BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "mb"
            ImageIndex      =   4
            Style           =   1
         EndProperty
         BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "mi"
            ImageIndex      =   5
            Style           =   1
         EndProperty
      EndProperty
   End
   Begin VB.TextBox Text1 
      Height          =   2235
      Left            =   900
      MultiLine       =   -1  'True
      ScrollBars      =   3  'Both
      TabIndex        =   0
      Text            =   "sy08-07.frx":06F4
      Top             =   420
      Width           =   4635
   End
   Begin VB.Menu menu1 
      Caption         =   "菜单1"
      Begin VB.Menu menu13 
         Caption         =   "查找"
      End
      Begin VB.Menu bar 
         Caption         =   "-"
      End
      Begin VB.Menu menu11 
         Caption         =   "清除"
      End
      Begin VB.Menu menu12 
         Caption         =   "结束"
      End
   End
   Begin VB.Menu menu2 
      Caption         =   "菜单2"
      Begin VB.Menu menu21 
         Caption         =   "12号字体"
      End
      Begin VB.Menu menu22 
         Caption         =   "16号字体"
      End
      Begin VB.Menu menu23 
         Caption         =   "粗体"
      End
      Begin VB.Menu menu24 
         Caption         =   "斜体"
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub menu11_Click()
    Text1.Text = ""                               ' 清除文本框中的内容
End Sub

Private Sub menu12_Click()
    End
End Sub

Private Sub menu13_Click()
    Form2.Show
End Sub

Private Sub menu21_Click()
    Text1.FontSize = 12                           ' 设置字体大小
End Sub
Private Sub menu22_Click()
    Text1.FontSize = 16                           ' 设置字体大小
End Sub
Private Sub menu23_Click()
    menu23.Checked = Not menu23.Checked          ' 控制"√"标记显示与否
    Text1.FontBold = menu23.Checked               ' 粗体
End Sub
Private Sub menu24_Click()
    menu24.Checked = Not menu24.Checked
    Text1.FontItalic = Not Text1.FontItalic            ' 斜体，与粗体控制功能类似
End Sub

Private Sub Text1_Change()
    If Text1 = "" Then
    menu2.Visible = False
    Else
    menu2.Visible = True
    End If
End Sub

Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 2 Then PopupMenu menu2
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 2 Then PopupMenu menu2
End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
    Select Case Button.Key
    Case "mfind"                            ' 查找按钮
        menu13_Click
    Case "mdel"                             ' 清除
        menu11_Click
    Case "mfont"                            ' 字号
        menu21_Click
    Case "mb"                               ' 粗体
        menu23_Click
    Case "mi"                               ' 斜体
        menu24_Click
    End Select
End Sub
Private Sub Toolbar1_ButtonMenuClick(ByVal ButtonMenu As MSComctlLib.ButtonMenu)
    Select Case ButtonMenu.Key
    Case "m12"                                  ' 12号字
        menu21_Click
    Case "m16"                                  ' 16号字
        menu22_Click
    End Select
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    If Shift = 1 Then
       Txt = "SHIFT"
    ElseIf Shift = 2 Then
       Txt = "CTRL"
    ElseIf Shift = 4 Then
       Txt = "ALT"
    Else
       Txt = ""
    End If
    StatusBar1.Panels(1).Text = Txt
End Sub

