JumpTask.IconResourceIndex JumpTask.IconResourceIndex JumpTask.IconResourceIndex JumpTask.IconResourceIndex Property

定义

获取或设置嵌入在资源中的图标的索引,索引从零开始。Gets or sets the zero-based index of an icon embedded in a resource.

public:
 property int IconResourceIndex { int get(); void set(int value); };
public int IconResourceIndex { get; set; }
member this.IconResourceIndex : int with get, set
Public Property IconResourceIndex As Integer

属性值

图标的从零开始的索引;如果未使用图标,则为 -1。The zero-based index of the icon, or -1 if no icon is used. 默认值为 0。The default is 0.

示例

下面的示例演示如何声明JumpTask标记中。The following example shows how to declare a JumpTask in markup. JumpTask将打开一个名为文本文件readme.txt记事本应用程序中。The JumpTask opens a text file named readme.txt in the Notepad application.

<JumpTask Title="Read Me" 
          Description="Open readme.txt in Notepad." 
          ApplicationPath="C:\Windows\notepad.exe"
          IconResourcePath="C:\Windows\System32\imageres.dll"
          IconResourceIndex="14"
          WorkingDirectory="C:\Users\Public\Documents"
          Arguments="readme.txt"/>

注解

与一起使用的图标JumpTask必须可用作本机资源。An icon used with a JumpTask must be available as a native resource. 如果 DLL 或可执行文件中提供了多个图标,指定是要使用通过指示中的偏移量IconResourceIndex属性。If multiple icons are available in a DLL or executable file, you specify the one to use by indicating an offset in the IconResourceIndex property.

如果未不指定任何图标资源,或者如果找不到指定的图标,将显示标准系统图标。If no icon resource is specified, or if the specified icon is not found, the standard system icon is displayed. 若要指定将显示任何图标,设置IconResourceIndex属性设置为-1。To specify that no icon is displayed, set the IconResourceIndex property to -1.

适用于

另请参阅