Winforms Treeview Control在发布模式下不起作用 [英] Winforms Treeview Control does not work in release mode

查看:97
本文介绍了Winforms Treeview Control在发布模式下不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在.NET 3.5中有一个Winforms应用程序.我正在使用Treeview控件并将其绑定到数据库表.所有的单击和展开事件在开发/调试模式下都可以正常工作.但是,当我以发布"模式为应用创建安装程序包并将其安装在同一台计算机(或其他机器)上时,单击并展开事件不工作. CP专家有何建议?

Hi
I have a Winforms App in .NET 3.5. I am using a Treeview Control and binding it to the database table(s). All the click and expand events work fine in development/debug mode.However , when I create a setup package in ''Release'' mode for the app and install it on the same machine (or other), then the click and expand events do not work. Any suggestions from the CP experts?

推荐答案

在部署时,我的树形视图遇到了一个奇怪的问题,在加载应用程序时必须添加以下几行. />
我将此代码放入main()启动方法中:
I ran into a odd issue with my treeview when deploying, I had to add the following lines when loading the application.

I put this code in main() startup method:
System.Windows.Forms.Application.EnableVisualStyles();
System.Windows.Forms.Application.DoEvents();


这篇关于Winforms Treeview Control在发布模式下不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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