简体   繁体   English

C#Winform Menustrip Toolstripitem在鼠标悬停时间延迟问题上更改图像

[英]C# Winform Menustrip Toolstripitem change image on mouse hover time delay issue

I have menustrip with 5 items. 我有5个项目的menustrip。 I have set a image to each toolstripitem. 我已经为每个工具设置了一个图像。 Now, I wish to change the image whenever hover the toolstripitem and I used the below code. 现在,我希望在使用tooltripitem时更改图像,并使用下面的代码。

        void item_MouseLeave(object sender, EventArgs e)
    {
        (sender as ToolStripItem).Image = Resources.gray;
    }

    void item_MouseHover(object sender, EventArgs e)
    {
        (sender as ToolStripItem).Image = Resources.blue;
    }

And it works fine. 它工作正常。 But I need to wait a second to view the blue image. 但我需要等一下才能看到蓝色图像。 How do I resolve this time delay? 我如何解决这个时间延迟?

使用MouseEnter事件而不是鼠标悬停。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM