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. 在记事本应用程序中readme.txt 打开一个名为的文本文件。JumpTaskThe 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.

适用于

另请参阅