Font是VB保护字,换个变量名字。

解决方案 »

  1.   

    你的窗体里都有什么控件?它们都有Font属性吗?如果没有当然出错了。(如按钮)
      

  2.   

    前面加On error resume next
      

  3.   

    试验成功了,这样就可以:
    Public FFont As VB.Form
    Public CFont As VB.ControlPublic Sub FontChange()
        On Error Resume Next
        
        For Each FFont In Forms
            For Each CFont In FFont.Controls
                CFont.FontName = "黑体"
            Next
        Next
    End Sub