I have menustrip with 5 items. 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.
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事件而不是鼠标悬停。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.