vb6升级vb.net问题
我将我的项目从 vb6 转换为 vb.net
在 vb6 项目中我创建了 3 个用户控件(用于 LED 显示控制)
我将项目升级到 .net 3.5 中的 vb.net。
我修复了升级问题带来的所有错误。
但是现在在表单上加载用户控件需要太多时间
是否有任何方法可以进行代码优化或其他任何事情,以便我可以快速在表单上加载用户控件正如在 vb6 形式上
一样,我的 CPU 利用率也增加了很多,高达 90%
这背后的原因是什么。
I converted my project from vb6 to vb.net
In vb6 project i created 3 user controls (for LED DISPLAY CONTROL)
I upgraded project to vb.net in .net 3.5.
I fixed all bugs that comes from upgrade issue.
But now while loading the user control on form it takes too much time
Is there any way for code optimization or anything else so that I can load user control on my form as fast as on vb6 form
Also my CPU utilization increases very much up to 90%
What is the reason behind this .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
转化不佳。我还没有看到任何大小合适的 VB6 到 .NET 转换代码在转换后无需手动优化即可表现良好。 .NET 中的事件触发方式不同,并且有一些不同的事件可能比 VB6 中使用的事件更好用;事件可能是根本问题。如果您想要更好的答案,您需要发布代码。
Poor conversion. I have yet to see any decent sized VB6 to .NET converted code perform well without manual optimization after the conversion. Events fire differently in .NET and there are different events that may be better to use than what was used in VB6; events are likely the underlying problem. You need to post the code if you want better answers.
可能用户控件的加载和执行顺序与 VB6 中的不同,而且加载和执行的次数也可能不同。添加一些断点来查看每个控件何时被初始化(以及多少次),并确保所有内容都按照与 VB6 中相同的顺序运行。
另外,请确保在表单初始化期间没有调用用户或 Windows 控件中的任何事件。
Probably the user controls are being loaded and executed in different order and maybe a different number of times than in VB6. Add some breakpoints to see when each control is being initialized (and how many times), and make sure everything runs in the same order as it did in VB6.
Also, make sure there are no events, in user OR Windows controls, being called during form initialization.