完成加载后显示表格吗?

编程入门 行业动态 更新时间:2024-10-04 07:23:16
本文介绍了完成加载后显示表格吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的主窗体在加载时需要一段时间才能完成显示

my main form when load have It takes a while to Complete show how i can when form Complete ,show it?

推荐答案

请参阅我对问题的评论. 显然,您已经在显示表单之后执行了一些操作.有时您确实需要它. 解决这种情况的通常方法是使用启动画面". 您将在CodeProject文章中找到很多代码: www.codeproject/search.aspx?doctypeid=1&q=%22splash+screen%22+%22C%23%22 [ ^ ]. 还可以通过Google搜索: en.lmgtfy/?q =%22splash + screen%22 +%22C%23%22 + Forms [ ^ ]. --SA Please see my comment to the question. You apparently do something after the form is already shown. Sometimes you really need it. The usual way to handle this situation is using the "splash screen". You will find a lot of codes in CodeProject articles: www.codeproject/search.aspx?doctypeid=1&q=%22splash+screen%22+%22C%23%22[^]. Search also with Google: en.lmgtfy/?q=%22splash+screen%22+%22C%23%22+Forms[^]. --SA

只需添加SA给您的答案-在表单准备好完全显示之前,让用户完全不显示是个好主意.这使用户怀疑他是否真的激活了该应用程序,并且他们倾向于一次又一次地尝试. 您应该在第一秒左右的时间内显示某物,无论是局部显示还是启动屏幕,只是为了向用户保证发生了什么事情. 如果您的表单加载缓慢,则取决于如何显示/填充表单以及如何加快处理速度.例如,如果您要从数据库中将大量数据加载到DataGridView中,那可能就是所有问题,更好的解决方案可能是将加载代码移到单独的线程或页面中您的显示器.这完全取决于您显示的内容,以使其更快! Just to add to the answer SA gave you - it is not a good idea to leave teh user with no display at all until the form is ready to fully display. This make teh user doubt if he actually activated the application at all, and they tend to try again, and again, and again. You should aim to display something in the first second or so, be it a partial form or a splash screen, just to reassure the user that something is happening. If you form is loading slowly, it will depend on what you are showing / filling it with as to how it is possible to speed the process up. If you are (for example) loading a lot of data from a database into a DataGridView, that could be the problem all on it''s own, and a better solution may be to move the load code into a separate thread, or page your display. It all depends on what you display how you make it faster!

更多推荐

完成加载后显示表格吗?

本文发布于:2023-11-26 23:17:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1635613.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表格   加载

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!