SPFieldCollection.Add 方法 (String, SPFieldType, Boolean, Boolean, StringCollection)

基于指定的显示名称、 字段类型和布尔值的其他字段属性和在Choice字段的情况下选择上集合中创建一个字段。

命名空间:  Microsoft.SharePoint
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
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
    类型:System.String

    一个字符串,指定该字段的显示名称。

  • bRequired
    类型:System.Boolean

    true要求域必须包含一个值 ;否则为false。

  • bCompactName
    类型:System.Boolean

    true压缩为八个字符 ; 字段名称否则为false。

返回值

类型:System.String
一个字符串,包含新字段的内部名称。

另请参阅

引用

SPFieldCollection 类

SPFieldCollection 成员

Add 重载

Microsoft.SharePoint 命名空间