防止事件期间屏幕闪烁

发布于 2024-08-02 05:39:43 字数 223 浏览 5 评论 0原文

大家好,我知道在 vb 的原始版本中(如 Excel 中所示),您可以插入一行以防止屏幕在尝试处理某些内容时来回闪烁。

Application.screenupdating = false

我目前在 Visual Studio 2008 中使用 vb.net,但我想知道是否有人知道该版本的等效项。它无法识别使用 vb.net 的 VS 2008 中的此调用。任何帮助,将不胜感激! 预先感谢各位!

Hey guys, I know that in primitive versions of vb (as found in excel) there was a line that you could insert to prevent screens from flickering to and fro when it is trying to process something.

Application.screenupdating = false

I am currently using vb.net in Visual Studio 2008 but i was wondering if anyone knows the equivilent for this version. It doesnt recognise this call in VS 2008 using vb.net. Any help would be appreciated!
Thanks in advance guys!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

飘逸的'云 2024-08-09 05:39:43

取决于控制。很多控件(例如 ListView)都有 BeginUpdate 和 endUpdate 方法来实现这一确切目的。

list.BeginUpdate()
list.Items.Add(...)
list.Items.Add(...)
list.Items.Add(...)
...
list.EndUpdate()

Depends on control. Quite a lot of controls (e.g. ListView) have BeginUpdate and endUpdate methods that server that exact purpose.

list.BeginUpdate()
list.Items.Add(...)
list.Items.Add(...)
list.Items.Add(...)
...
list.EndUpdate()
_失温 2024-08-09 05:39:43

SuspendLayout 和 ResumeLayout 方法应该可以解决问题。 SuspendLayout 会阻止控件/窗体重新绘制自身,直到您调用 ResumeLayout 方法。

The SuspendLayout and ResumeLayout methods should do the trick. SuspendLayout prevents a control/form from redrawing itself until you call the ResumeLayout method.

懒的傷心 2024-08-09 05:39:43

Globals.ThisWorkbook.Application.ScreenUpdating = False

Globals.ThisWorkbook.Application.ScreenUpdating = False

怂人 2024-08-09 05:39:43

回复:当它尝试处理某些内容时,

您可以禁用该表单

re: when it is trying to process something

you can disable the form

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文