基于指定的显示名称、 字段类型和布尔值的其他字段属性和在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一个字符串,指定该字段的显示名称。
type
类型:Microsoft.SharePoint.SPFieldType一个SPFieldType值,指定要创建的字段类型。
bRequired
类型:System.Booleantrue要求域必须包含一个值 ;否则为false。
bCompactName
类型:System.Booleantrue压缩为八个字符 ; 字段名称否则为false。
choices
类型:System.Collections.Specialized.StringCollectionSystem.Collections.Specialized.StringCollection对象,该对象包含的Choice字段选项。
返回值
类型:System.String
一个字符串,包含新字段的内部名称。