1

This is what I have so far:

if (label1.Text == "On")
{
  notifyIcon1.Icon = Image.FromFile("@C:\Users\Alex\Downloads\On.ico");
}

What do I do make the icon equal to change it?

4

1 回答 1

2

这应该有效:除了显而易见的之外,我将 @ 放在引号之前。这可能无关紧要,只是我这样做的方式。

notifyIcon1.Icon = System.Drawing.Icon.ExtractAssociatedIcon(@"C:\Users\Alex\Downloads\On.ico");

你这对你有帮助!

于 2012-10-19T03:21:13.777 回答