在vb.net中的表单加载中发生异常

编程入门 行业动态 更新时间:2024-10-14 06:18:02
本文介绍了在vb中的表单加载中发生异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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中的表单加载中发生异常

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

发布评论

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

>www.elefans.com

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