Table of contents
TOC
折叠目录
展开目录

TextBox.FontBold 属性 (访问)TextBox.FontBold Property (Access)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

可以使用FontBold属性来指定字体是否加粗样式在下列情况中出现:You can use the FontBold property to specify whether a font appears in a bold style in the following situations:

  • 在显示或打印窗体和报表上的控件时。When displaying or printing controls on forms and reports.

  • 当报表上使用Print方法。When using the Print method on a report.

读/写boolean 类型的值Read/write Boolean.

语法Syntax

表达式FontBoldexpression. FontBold

表达式_一个表示文本框对象的变量。_expression A variable that represents a TextBox object.

注解Remarks

FontBold属性使用以下设置。The FontBold property uses the following settings.

设置Setting说明Description
TrueTrue文本加粗。The text is bold.
FalseFalse(默认值)文本不加粗。(Default) The text isn't bold.

若要在报表中使用的FontBold属性,首先创建Print事件过程输出所需的文本。To use the FontBold property on a report, first create a Print event procedure that prints the desired text.

字体在屏幕上的外观与打印出来的效果可能会有所不同,这取决于所使用的计算机和打印机。A font's appearance on screen and in print may differ, depending on your computer and printer.

属性之间的关系,这是在属性表控件中可用,也可以用于设置控件的文本的线条宽度。FontBold属性让您可以很快地使文本加粗;属性之间的关系可以更好地控制文本的线宽设置。下表显示了这些属性设置之间的关系。The FontWeight property, which is available in the property sheet for controls, can also be used to set the line width for a control's text. The FontBold property gives you a quick way to make text bold; the FontWeight property gives you finer control over the line width setting for text. The following table shows the relationship between these properties' settings.

如果If然后Then
FontBold = FontBold = False粗细= 正常 (400)FontWeight = Normal (400)
FontBold = ,则返回 TrueFontBold = True粗细= 加粗 (700)FontWeight = Bold (700)
粗细< 700FontWeight < 700FontBold = FontBold = False
粗细> = 700FontWeight > = 700FontBold = ,则返回 TrueFontBold = True

示例Example

下面的 Print 事件过程以CurrentX当前属性设置所指定的坐标处报告上打印报表标题和当前日期中粗体样式。The following Print event procedure prints a report title and the current date in a bold style on a report at the coordinates specified by the CurrentX and CurrentY property settings.

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

另请参阅See also

概念Concepts

TextBox 对象TextBox Object

© 2018 Microsoft