Skip to content

NotifyIcon can not change icon resource while NotifyIcon.IsBlink = false(托盘图标在关闭闪烁功能时无法更换图标) #476

Closed

Description

@shuiyantiao

Describe the bug
I can not change NotifyIcon's icon while NotifyIcon.IsBlink = false . Here is the example demo
https://github.com/shuiyantiao/HCNotifyIconTest

当托盘图标控件的IsBlink属性为False时,无法通过直接指定控件的Icon属性来替换显示的图标。
重现问题的demo: https://github.com/shuiyantiao/HCNotifyIconTest

To Reproduce
Steps to reproduce the behavior:

  1. Create a NotifyIcon and set a default icon.
  2. Try changing icon source, and fail.
  3. Try changing icon source with NotifyIcon.IsBlink = true at first and NotifyIcon.IsBlink = false after change.
  4. The icon source change as expected.

1.创建一个托盘图标并设定它的默认图标
2.尝试更换图标资源,替换失败。
3.尝试在替换前将IsBlink设定为true,替换后设定为false,替换成功。

Expected behavior
The icon source can be changed while just set NotifyIcon.Icon

在Icon属性被重新指定时即改变托盘图标。

Environment (please complete the following information):

  • .Net Core 3.1
  • VS2019 16.7.3
  • Windows 10 1909 18363.1082

Additional context
Reappearance demo : https://github.com/shuiyantiao/HCNotifyIconTest

重现问题的demo : https://github.com/shuiyantiao/HCNotifyIconTest

Activity

  1. added a commit that references this issue on Mar 2, 2025
    d1f6b5f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址