VB 6.0中怎样读取系统字体在列表框显示?

2026年09月23日 11:43
有2个网友回答
网友(1):

添加一个列表框List1和一个按钮Command1。代码

Option Explicit

Private Sub Command1_Click()
Dim I As Integer
List1.Clear
For I = 0 To Screen.FontCount - 1
List1.AddItem Screen.Fonts(I)
Next
End Sub

'最好把List1的Sorted属性设置为True这样ListBox会自动排序。

网友(2):

Private
Sub
Form_Load()

For
i
=
0
To
Screen.FontCount
-
1

List1.AddItem
Screen.Fonts(i)

Next
i
End
Sub