VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3165
   ClientLeft      =   165
   ClientTop       =   735
   ClientWidth     =   5430
   LinkTopic       =   "Form1"
   ScaleHeight     =   3165
   ScaleWidth      =   5430
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text1 
      Height          =   2235
      Left            =   0
      MultiLine       =   -1  'True
      ScrollBars      =   3  'Both
      TabIndex        =   0
      Text            =   "sy08-04.frx":0000
      Top             =   0
      Width           =   4635
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   600
      Top             =   2460
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.Menu menu1 
      Caption         =   "菜单1"
   End
   Begin VB.Menu menu2 
      Caption         =   "菜单2"
      Begin VB.Menu menu21 
         Caption         =   "号字体"
      End
      Begin VB.Menu menu22 
         Caption         =   "粗体"
      End
      Begin VB.Menu menu23 
         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 Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 2 Then PopupMenu menu2
End Sub

Private Sub menu1_Click()
    CommonDialog1.Flags = cdlCFBoth Or cdlCFEffects
    CommonDialog1.ShowFont                          ' 或用Action = 4
    If CommonDialog1.FontName > " " Then                 ' 如果选择了字体
        Text1.FontName = CommonDialog1.FontName         ' 设置文本框内的字体
    End If
    Text1.FontSize = CommonDialog1.FontSize                 ' 设置字体大小
    Text1.FontBold = CommonDialog1.FontBold             ' 设置粗体字
    Text1.FontItalic = CommonDialog1.FontItalic             ' 设置斜体字
    Text1.FontStrikethru = CommonDialog1.FontStrikethru     ' 设置删除线
    Text1.FontUnderline = CommonDialog1.FontUnderline   ' 设置下划线
    Text1.ForeColor = CommonDialog1.Color               ' 设置颜色
    menu21.Caption = CommonDialog1.FontSize & "号字体"
    menu22.Checked = CommonDialog1.FontBold           ' 控制"√"标记显示与否
    menu23.Checked = CommonDialog1.FontItalic
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
