共用方式為


JumpTask.IconResourcePath 屬性

定義

取得或設定資源的路徑,這個資源包含要顯示於跳躍清單中的圖示。

public:
 property System::String ^ IconResourcePath { System::String ^ get(); void set(System::String ^ value); };
public string IconResourcePath { get; set; }
member this.IconResourcePath : string with get, set
Public Property IconResourcePath As String

屬性值

String

包含圖示之資源的路徑。 預設為 null

範例

下列範例示範如何在標記中宣告 JumpTask 。 會在 JumpTask 記事本應用程式中開啟名為 readme.txt 的文字檔。

<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 。 會 JumpTask 開啟計算機應用程式。

// Configure a new JumpTask.
JumpTask jumpTask1 = new JumpTask();
// Get the path to Calculator and set the JumpTask properties.
jumpTask1.ApplicationPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.SystemX86), "calc.exe");
jumpTask1.IconResourcePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.SystemX86), "calc.exe");
jumpTask1.Title = "Calculator";
jumpTask1.Description = "Open Calculator.";
jumpTask1.CustomCategory = "User Added Tasks";

備註

與 搭配 JumpTask 使用的圖示必須以原生資源的形式提供。 如果 DLL 或可執行檔中有多個圖示可用,您可以藉由指示 屬性中的 IconResourceIndex 位移來指定要使用的圖示。

如果未指定任何圖示資源,或找不到指定的圖示,則會顯示標準系統圖示。 若要指定未顯示任何圖示,請將 IconResourceIndex 屬性設定為 -1。

適用於

另請參閱