矩形以Windows形式闪烁 [英] Rectangle to blink in windows form

查看:95
本文介绍了矩形以Windows形式闪烁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从列表视图中选择矩形时,如何使矩形以Windows形式闪烁?

How can i make the rectangle blink in windows form when i select it from a list view?

推荐答案

在这里...什么样的矩形?这是Microsoft.VisualBasic.PowerPack的RectangleShape吗?还是您以编程方式绘制它?

无论哪种方式,我都会使用一个计时器.只需将间隔设置为您希望其闪烁"的速度即可.然后在Timer_Tick上,使其闪烁.

如果是RectangleShape,只需运行
Well, there''s not a lot to go on here...what kind of rectangle? Is this the RectangleShape from Microsoft.VisualBasic.PowerPack? Or are you drawing it programmatically?

Either way, I would use a Timer. Just set the Interval to however quickly you want it to "blink". Then on the Timer_Tick, blink it.

If it''s a RectangleShape, just run
RectangleShape1.Visible = !RectangleShape1.Visible;



如果要绘制,则必须做更多的工作……使矩形的区域无效,然后根据您上次所做的操作绘制或不绘制.



If you''re drawing it, then you''ll have to do a little more...invalidating the region of the rectangle and then either drawing or not drawing based on what you did last time.


这篇关于矩形以Windows形式闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆