WebPart.TitleIconImageUrl 属性

获取或设置用于表示 Web 部件标题栏中的图像的 URL。

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

语法

声明
<WebPartStorageAttribute(Storage.None)> _
Public Overrides Property TitleIconImageUrl As String
    Get
    Set
用法
Dim instance As WebPart
Dim value As String

value = instance.TitleIconImageUrl

instance.TitleIconImageUrl = value
[WebPartStorageAttribute(Storage.None)]
public override string TitleIconImageUrl { get; set; }

属性值

类型:System.String
包含 URL string 。默认值是String.Empty。

实现

IWebPart.TitleIconImageUrl

备注

TitleIconImageUrl属性提供了一种方法在 Web 部件控件的标题栏中放置的小图像。为了确保主题一致性,应用程序开发人员通常会使此图标类似于所代表的 Web 部件控件 ( CatalogIconImageUrl属性中引用的图像) 的目录中的控件的图像。

在代码中的控件或以声明方式 Web 部件控件说明文件 (.webpart) 的标记中,您可以以编程方式设置属性的值。

示例

The following example shows how to set the TitleIconImageUrl property declaratively in a Web Part control description file. This example uses the Web Part created in Walkthrough: Creating a Basic SharePoint Web Part.

<?xml version="1.0" encoding="utf-8" ?> 
  <webParts>
     <webPart xmlns="https://schemas.microsoft.com/WebPart/v3">
       <metaData>
         <type name="MyWebParts.SimpleWebPart, Version=1.0.0.0, Culture=neutral,
         PublicKeyToken=PublicKeyToken" /> 
         <importErrorMessage>Cannot import this Web 
         Part.</importErrorMessage> 
       </metaData>
       <data>
         <properties>
           <property name="Title" type="string">My Simple Web Part</property>
           <property name="Description" type="string">A simple Web Part</property>
            <property name= "TitleIconImageUrl" type="string">/_layouts/images/mscntvwl.gif</property>
         </properties>
       </data>
     </webPart>
   </webParts>

另请参阅

引用

WebPart 类

WebPart 成员

Microsoft.SharePoint.WebPartPages 命名空间