宣告項目特性 (Visual Basic)Declared Element Characteristics (Visual Basic)

A特性的宣告的項目是如何與其互動的程式碼會影響該元素的層面。A characteristic of a declared element is an aspect of that element that affects how code can interact with it. 每個宣告的項目有一或多個與它相關的下列特性:Every declared element has one or more of the following characteristics associated with it:

項目特性Characteristics of the Elements

下表顯示宣告的項目並套用至每一個的特性。The following table shows the declared elements and the characteristics that apply to each one.

項目Element 資料類型Data Type 存留期Lifetime 範圍1Scope 1 存取層級Access Level
變數Variable Yes Yes Yes Yes
常數Constant Yes No Yes Yes
列舉Enumeration Yes No Yes Yes
結構Structure No No Yes Yes
屬性Property Yes Yes Yes Yes
方法Method No Yes Yes Yes
程序 (SubFunction)Procedure (Sub or Function) No Yes Yes Yes
程序參數Procedure parameter Yes Yes Yes No
函式傳回Function return Yes Yes Yes No
運算子Operator Yes No Yes Yes
介面Interface No No Yes Yes
類別Class No No Yes Yes
Event - 事件Event No No Yes Yes
Delegate - 委派Delegate No No Yes Yes

1範圍有時稱為可視性1 Scope is sometimes referred to as visibility.

另請參閱See also