⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 很多的vb经典源代码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "字体浏览器"
   ClientHeight    =   4275
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   7020
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4275
   ScaleWidth      =   7020
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.ListBox List3 
      Columns         =   2
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2370
      Left            =   5520
      TabIndex        =   5
      Top             =   360
      Width           =   1335
   End
   Begin VB.CommandButton Command2 
      Caption         =   "删除用户字体列表的当前项"
      Height          =   735
      Left            =   1440
      TabIndex        =   4
      Top             =   3240
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "清除用户已选的字体列表"
      Height          =   735
      Left            =   120
      TabIndex        =   2
      Top             =   3240
      Width           =   1215
   End
   Begin VB.ListBox List2 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2370
      Left            =   2880
      TabIndex        =   1
      Top             =   360
      Width           =   2415
   End
   Begin VB.ListBox List1 
      Height          =   2370
      Left            =   120
      Style           =   1  'Checkbox
      TabIndex        =   0
      Top             =   360
      Width           =   2535
   End
   Begin VB.Label Label4 
      Caption         =   "字体示例:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   2880
      TabIndex        =   9
      Top             =   2820
      Width           =   1050
   End
   Begin VB.Label Label3 
      Caption         =   "字体大小:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   5520
      TabIndex        =   8
      Top             =   60
      Width           =   1050
   End
   Begin VB.Label Label2 
      Caption         =   "用户已选的字体列表:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   2880
      TabIndex        =   7
      Top             =   60
      Width           =   2100
   End
   Begin VB.Label Label1 
      Caption         =   "系统字体列表:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   120
      TabIndex        =   6
      Top             =   60
      Width           =   1470
   End
   Begin VB.Label LabPreView 
      BorderStyle     =   1  'Fixed Single
      Caption         =   "中文字体AaBbYyZz"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   975
      Left            =   2880
      TabIndex        =   3
      Top             =   3120
      Width           =   3975
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Command1_Click()
    List2.Clear
End Sub

Private Sub Command2_Click()
    List2.RemoveItem List2.ListIndex
    

End Sub

Private Sub Command3_Click()

End Sub

Private Sub Form_Load()
Dim i As Integer
For i = 0 To Printer.FontCount - 1
    List1.AddItem Printer.Fonts(i)
Next i
'-----
List3.Clear
For i = 8 To 12
   List3.AddItem Trim(Str(i))
Next i
For i = 14 To 72 Step 2
   List3.AddItem Trim(Str(i))
Next i


    
End Sub

Private Sub List1_ItemCheck(Item As Integer)
    List2.AddItem List1.Text
 
End Sub

Private Sub List2_Click()
LabPreView.FontName = List2.Text
End Sub

Private Sub List3_Click()
LabPreView.FontSize = Val(List3.Text)
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -