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

取得或設定是否指定的控制項會自動調整垂直列印或預覽控制項包含的所有資料。Gets or sets whether the specified control automatically adjusts vertically to print or preview all the data that the control contains. 可讀寫的 BooleanRead/write Boolean.


運算式雖然 CanShrinkexpression.CanShrink

_運算式_代表**ComboBox** 物件的變數。expression A variable that represents a ComboBox object.


雖然 CanShrink 屬性使用下列設定值。The CanShrink property uses the following settings.

設定Setting Visual BasicVisual Basic 描述Description
Yes TrueTrue 控制項垂直調小,讓其中所包含的全部資料能被列印或預覽,不會出現空白行。The control shrinks vertically so that the data it contains can be printed or previewed without leaving blank lines.
No FalseFalse (預設值) 控制項將不調小。(Default) The control doesn't shrink.

此屬性設定值在除了 [設計檢視] 外的其他檢視下,於巨集或 Visual Basic 中都是唯讀的。This property setting is read-only in a macro or Visual Basic in any view but Design view.

您可以使用該屬性來控制列印表單和報表的外觀。You can use this property to control the appearance of printed forms and reports. 當您將屬性設定為 [是] 時,物件會自動調整以使任何數量的資料可以列印。When you set the property to Yes, the object automatically adjusts so that any amount of data can be printed. 當控制項縮小時,下面的控制項將移往資料頁之上方。When a control shrinks, the controls below it move up the page.

如果您將控制項的 CanShrink 屬性設定為 [是] 時,Microsoft Access 不將區段的 CanShrink 屬性設定為 [是]。If you set a control's CanShrink property to Yes, Microsoft Access does not set the section's CanShrink property to Yes.

章節垂直壓縮他們的整個寬度。Sections shrink vertically across their entire width. 例如,假設表單] 區段中有兩個文字方塊並排顯示與每個控制項有其 CanShrink 屬性設定為 [是]。For example, suppose a form has two text boxes side by side in a section, and each control has its CanShrink property set to Yes. 如果一個文字方塊會包含一行的資料及 [其他] 文字方塊中包含兩個資料行,這兩個文字方塊都會兩行長因為] 區段中會跨整個寬度調整大小。If one text box contains one line of data and the other text box contains two lines of data, both text boxes will be two lines long because the section is sized across its entire width. 若要壓縮資料獨立,您可以將兩個的子表單或子報表控制項並排顯示並將其CanShrink屬性設定為 [是]。To shrink the data independently, you can place two subform or subreport controls side by side and set their CanShrink property to Yes.

當您使用 CanShrink 屬性時,請記得:When you use the CanShrink property, remember that:

  • 屬性設定不會影響控制項; 之間的水平間距它們會影響僅限控制項所佔有的垂直空間。The property settings don't affect the horizontal spacing between controls; they affect only the vertical space that the controls occupy.

  • 重疊的控制項不能調小。Overlapping controls can't shrink.

  • 較大控制項之高度能避免臨近之控制項變小。The height of a large control can prevent controls beside it from shrinking. 例如,如果數個較短的控制項位於左側的報告詳細資料] 區段中,且一個較高的控制項,例如未結合的物件框右側,左邊的控制項不會壓縮,即使它們包含任何資料。For example, if several short controls are on the left side of a report's detail section, and one tall control, such as an unbound object frame, is on the right side, the controls on the left won't shrink, even if they contain no data.

支援和意見反應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.