Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

適用對象

AccessObject 物件

Control 物件

Label 物件

Page 物件

SubForm 物件

BoundObjectFrame 物件

CurrentProject 物件

Line 物件

PageBreak 物件

TabControl 集合物件

CheckBox 物件

CustomControl 物件

ListBox 物件

Rectangle 物件

TextBox 物件

CodeProject 物件

Form 物件

ObjectFrame 物件

Report 物件

ToggleButton 物件

ComboBox 物件

GroupLevel 物件

OptionButton 物件

Section 物件

CommandButton 物件

Image 物件

OptionGroup 物件

SmartTag 物件

適用於 AccessObject、CodeProject 和 CurrentProject 物件的 Properties 屬性。

傳回 AccessObjectCurrentProjectCodeProject 物件的 AccessObjectProperties 集合物件的參照。

expression.Properties

運算式 必要。 傳回上述其中一個對象的表達式。

備註

AccessObjectProperties 集合物件是與 AccessObjectCurrentProjectCodeProject 物件相關的所有屬性的集合。 您可以使用成員物件的索引或代表成員物件名稱的字串運算式,來參照集合中的個別成員。 集合中的第一個成員物件的索引值為 0,集合中的成員物件總數為 AccessObjectProperties 集合物件的 Count 屬性值減 1。

您無法使用 Properties 屬性從透過 CurrentData 物件存取之集合成員的 AccessObject 物件傳回屬性。

適用於 SmartTag 物件的 Properties 屬性。

傳回代表特定智慧標籤之屬性集合的 SmartTagProperties 集合。

expression.Properties()

運算式 必要。 傳回 SmartTag 物件的表達式。

適用於「適用對象」清單中所有其他物件的 Properties 屬性。

傳回控制項的 Properties 集合物件的參照。

expression.Properties

運算式 必要。 傳回 [套用至] 清單中其中一個對象的表達式。

備註

Properties 集合物件是與控制項相關的所有屬性的集合。 您可以使用成員物件的索引或代表成員物件名稱的字串運算式,來參照集合中的個別成員。 集合中的第一個成員物件的索引值為 0,集合中的成員物件總數為 Properties 集合物件的 Count 屬性值減 1。

範例

以下程序會使用 Properties 屬性將 [偵錯] 視窗中與表單控制項關聯的所有屬性列印出來。 若要執行此程式碼,請將 cmdListProperties 命令按鈕放置於表單,並將以下程式碼複製到表單的 Declarations 區段。 然後按一下命令按鈕來列印 [偵錯] 視窗中的屬性清單。

Private Sub cmdListProperties_Click()
ListControlProps Me
End Sub
Public Sub ListControlProps(ByRef frm As Form)
Dim ctl As Control
Dim prp As Property
On Error GoTo props_err
For Each ctl In frm.Controls
Debug.Print ctl.Properties("Name")
For Each prp In ctl.Properties
Debug.Print vbTab & prp.Name & _
" = " & prp.Value
Next prp
Next ctl
props_exit:
Set ctl = Nothing
Set prp = Nothing
Exit Sub
props_err:
If Err = 2187 Then
Debug.Print vbTab & prp.Name & _
" = Only available at design time."
Resume Next
Else
Debug.Print vbTab & prp.Name & _
" = Error Occurred: " & Err.Description
Resume Next
End If
End Sub

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×