共用方式為


SPFieldCollection.Add method (String, SPFieldType, Boolean, Boolean, StringCollection)

建立根據指定的顯示名稱、 欄位型別、 其他欄位屬性和在Choice欄位的情況下選擇的布林值的集合中的欄位。

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
Public Function Add ( _
    strDisplayName As String, _
    type As SPFieldType, _
    bRequired As Boolean, _
    bCompactName As Boolean, _
    choices As StringCollection _
) As String
'用途
Dim instance As SPFieldCollection
Dim strDisplayName As String
Dim type As SPFieldType
Dim bRequired As Boolean
Dim bCompactName As Boolean
Dim choices As StringCollection
Dim returnValue As String

returnValue = instance.Add(strDisplayName, _
    type, bRequired, bCompactName, choices)
public string Add(
    string strDisplayName,
    SPFieldType type,
    bool bRequired,
    bool bCompactName,
    StringCollection choices
)

參數

  • strDisplayName
    Type: System.String

    字串,指定欄位的顯示名稱。

  • bRequired
    Type: System.Boolean

    true要求欄位包含值。否則, false。

  • bCompactName
    Type: System.Boolean

    若要壓縮八個字元 ; 欄位名稱的true否則, false。

傳回值

Type: System.String
字串,包含新的欄位的內部名稱。

請參閱

參照

SPFieldCollection class

SPFieldCollection members

Add overload

Microsoft.SharePoint namespace