使用 FontBold 属性可以指定字体在下列情况中是否以粗体样式显示:
说明
FontBold 属性使用以下的设置:
设置 | 说明 |
---|---|
True | 文本加粗。 |
False | (默认值)文本不加粗。 |
若要在报表中使用 FontBold 属性,请首先创建打印所需文本的“打印”事件过程。
字体在屏幕上的显示与打印的效果可能会不同,这取决于用户的计算机和打印机。
FontWeight 属性可在控件的属性表中获得,此属性用于设置控件文本的线宽。FontBold 属性提供了一种将文本设置为粗体的快捷方法;FontWeight 属性用于细微地控制文本的线宽。下表列出了这些属性设置之间的关系:
如果 | 则 |
---|---|
FontBold = False | FontWeight = Normal (400) |
FontBold = True | FontWeight = Bold (700) |
FontWeight < 700 | FontBold = False |
FontWeight > = 700 | FontBold = True |
下列 Print 事件过程,通过 CurrentX 和 CurrentY 属性设置来指定坐标位置,并在此坐标位置上以粗体字体打印报表标题和当前日期。
Private Sub ReportHeader0_Print(Cancel As Integer, _
PrintCount As Integer)
Dim MyDate
MyDate = Date
Me.FontBold = True
' Print report title in bold.
Me.Print("Sales Management Report")
Me.Print(MyDate)
End Sub