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

您可以使用這個屬性設定或傳回未針對表單或控制項的 BorderStyle 屬性的值。You can use this property to set or return the unedited value of the BorderStyle property for a form or control. 這個屬性才有用如果您需要回復至編輯或偏好的框線樣式。This property is useful if you need to revert to an unedited or preferred border style. 可讀寫的 ByteRead/write Byte.

語法Syntax

運算式OldBorderStyleexpression.OldBorderStyle

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

註解Remarks

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

設定Setting Visual BasicVisual Basic 描述Description
透明Transparent 00 (預設值,僅適用標籤、圖表和子報表)。透明的(Default only for label, chart, and subreport) Transparent
原色Solid 11 (預設值) 實線(Default) Solid line
虛線Dashes 22 虛線Dashed line
短虛線Short dashes 33 有短虛線的虛線Dashed line with short dashes
點線Dots 44 點線Dotted line
稀點狀線Sparse dots 55 點距離較寬的點線Dotted line with dots spaced far apart
虛線-點Dash dot 66 使用虛線-點組合的直線Line with a dash-dot combination
虛線-點-點Dash dot dot 77 使用虛線-點-點組合的直線Line with a dash-dot-dot combination
雙實線Double solid 8 8 雙實線Double solid lines

範例Example

下列範例會示範如何變更控制項的BorderStyle屬性同時影響OldBorderStyle的效果。The following example demonstrates the effect of changing a control's BorderStyle property while leaving the OldBorderStyle unaffected. 此範例已結束 BorderStyle 屬性設定為其原始未編輯的值。The example concludes with setting the BorderStyle property to its original unedited value.

With Forms("Order Entry").Controls("ZIP Code")
    .BorderStyle = 3 ' Short dashed border. 
  
    MsgBox "BorderStyle = " & .BorderStyle & vbCrLf & _ 
        "OldBorderStyle = " & .OldBorderStyle  ' Prints 3, 1. 
 
    .BorderStyle = 2 ' Dashed border. 
  
    MsgBox "BorderStyle = " & .BorderStyle & vbCrLf & _ 
        "OldBorderStyle = " & .OldBorderStyle  ' Prints 2, 1 
  
    .BorderStyle = .OldBorderStyle ' Solid (default) border. 
         
    MsgBox "BorderStyle = " & .BorderStyle & vbCrLf & _ 
        "OldBorderStyle = " & .OldBorderStyle  ' Prints 1, 1 
End With

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