ComboBox.FontBold 屬性 (Access)ComboBox.FontBold property (Access)

您可以使用 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.

可讀寫的 BooleanRead/write Boolean.

語法Syntax

運算式FontBoldexpression.FontBold

_運算式_代表**ComboBox** 物件的變數。expression A variable that represents a ComboBox 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.

FontWeight 屬性,也就是可在屬性表中的控制項,也可以用來設定線條寬度的控制項的文字。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. FontBold 屬性可讓您快速的方式將文字設為粗體; FontWeight 屬性可讓您更精細的控制能力文字的線條寬度設定。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.

IfIf ThenThen
FontBold = FalseFontBold = False FontWeight = 正常 (400)FontWeight = Normal (400)
FontBold = TrueFontBold = True FontWeight = 粗體 (700)FontWeight = Bold (700)
FontWeight < 700FontWeight < 700 FontBold = FalseFontBold = False
FontWeight > = 700FontWeight > = 700 FontBold = TrueFontBold = True

範例Example

下列Print事件程序會列印在CurrentXCurrentY屬性設定所指定的座標在報表上的報表標題和目前日期以粗體樣式。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

支援和意見反應Support and feedback

有關於 Office VBA 或這份文件的問題或意見反應嗎?Have questions or feedback about Office VBA or this documentation? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.