tokinaito
2019/04/12 (金) 09:02:40
bb5c2@2f12b
活用させて頂いているAutoFontSizeプログラム
Public Sub AutoFontSize(Ctr As Control, IniFontSize As Integer)
Const MinFontSize = 4 '最小のフォントサイズ
Const d = 53 'うまく収まらずに改行されてしまう場合はここの数値を増やす
Dim rpt As Report, Str As String, W As Long
Dim arStr, i As Integer, H As Long
Set rpt = CodeContextObject
With rpt
If Ctr.ControlType = acTextBox Then
Str = Nz(Ctr.Value, "") 'ここでエラーが出る場合は、Str = Nz(Ctr.Value,"")
ElseIf Ctr.ControlType = acLabel Then
Str = Ctr.Caption
Else
Exit Sub
End If
If Str = "" Then Exit Sub
.FontName = Ctr.FontName
通報 ...