在vb.net中的表单加载中发生异常 [英] Exception occur in form load in vb.net

查看:88
本文介绍了在vb.net中的表单加载中发生异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi ..
我在VB.NET2008中醒来.在我的项目中,添加一个Menustrip以提供所有报告名称,并通过单击该报告使用Tabcontrol进行查看.在该运行时中,我单击reportname会发生异常..
拖放注册未成功"
不能将顶级控件添加到控件中."

发生这种类型的异常,所以没有查看报告
是什么原因???
-----------------------------------
我已经发送了一个上面的问题?针对该答复,还有另外两行代码,但是在form_load中给出了
发生这种类型的异常..
无法设置指定的COM单元状态"

hi..
I am woking in VB.NET2008.. In my Project add a Menustrip to give all report name and using Tabcontrol to view by clicking the report.. In that runtime i am clicking reportname an exception is occur..
"dragdrop registration did not succeed"
"Top-level control cannot be added to a control."

This type of exception occur so didnt view the report
What the reason???
-----------------------------------
i already sent a above question??For that reply answer with two more line coding but i was given in form_load
this type of exception occur..
"Failed to set the specified COM apartment state"

推荐答案

看看您的代码,您在入口点之前是[System.STAThread]还是[STAThread](通常Main)?

如果没有,请添加.

如果这不能解决您的问题,请显示代码,尝试捕获异常并提供异常转储.不要忘记指出抛出异常的代码行.

—SA
Look at your code, do you have [System.STAThread] or just [STAThread] before your entry point (usually Main)?

If not, add it.

If this does not solve your problem, show your code, try to catch exception and provide exception dump. Don''t forget to indicate code line(s) where exception is thrown.

—SA


这篇关于在vb.net中的表单加载中发生异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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