这是报表的,但是我要窗体的。 Option Compare Database Option ExplicitDim F As Double '字体大小 Private Sub Report_Load() F = Me.Address.FontSize '在启动时先将正常字体保存起来 End SubPrivate Sub 主体_Format(Cancel As Integer, FormatCount As Integer) Dim cW As Double Me.Address.FontSize = F '每次主体格式化时,先将字体设为正常大小 If Me.Address.Width < Me.TextWidth(Me.Address) Then cW = (Me.Address.Width - 100) / Me.TextWidth(Me.Address) Me.Address.FontSize = Int(Me.Address.FontSize * cW) End If End Sub
Option Compare Database
Option ExplicitDim F As Double '字体大小
Private Sub Report_Load()
F = Me.Address.FontSize '在启动时先将正常字体保存起来
End SubPrivate Sub 主体_Format(Cancel As Integer, FormatCount As Integer)
Dim cW As Double
Me.Address.FontSize = F '每次主体格式化时,先将字体设为正常大小
If Me.Address.Width < Me.TextWidth(Me.Address) Then
cW = (Me.Address.Width - 100) / Me.TextWidth(Me.Address)
Me.Address.FontSize = Int(Me.Address.FontSize * cW)
End If
End Sub