user23176734
user23176734

Reputation:

Trouble setting Jump List icon in C#

I'm trying to set up a Jump List in my C# application using the Microsoft.WindowsAPICodePack.Taskbar library. I want to associate a custom icon with a JumpListLink, but I'm encountering an issue.

JumpList jumpList = JumpList.CreateJumpList();
pictureBox1.Image.Save(Path.Combine(Path.GetTempPath(), "Temp.ico"), ImageFormat.Icon);
JumpListLink customTask = new JumpListLink(Environment.GetCommandLineArgs()[0], "Image")
{
    Arguments = "Image arg",
    IconReference = new IconReference(Path.Combine(Path.GetTempPath(), "Temp.ico"))
};

Error:

Reference path in invalid. (Parameter 'refPath')

I'm getting an error at the line IconReference = new IconReference(Path.Combine(Path.GetTempPath(), "Temp.ico")).

Upvotes: 0

Views: 46

Answers (0)

Related Questions