JumpTask.IconResourcePath Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the path to a resource that contains the icon to display in the Jump List.
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
The path to a resource that contains the icon. The default is null
.
The following example shows how to declare a JumpTask in markup. 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"/>
The following example shows how to configure a JumpTask in code. The JumpTask opens the Calculator application.
// 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";
An icon used with a JumpTask must be available as a native resource. 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. To specify that no icon is displayed, set the IconResourceIndex property to -1.
Produit | Versions |
---|---|
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
Commentaires sur .NET
.NET est un projet open source. Sélectionnez un lien pour fournir des commentaires :