无法使用表单上的控件. [英] Unable to use controls on the form.
本文介绍了无法使用表单上的控件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了一些具有形式的静态实例.在后退按钮上,单击事件正在依次调用currentFormObj.Close();
和formObj.ShowDialog();
.出现一个异常,即值不在预期范围内".但是,当我使用formObj.Show();
时,会显示该表单,但无法访问该表单上的控件.您能帮上忙吗?
谢谢
Yashwanth
Hi,
I have created some static instances of forms i have. On back button click event am calling currentFormObj.Close();
followed by formObj.ShowDialog();
. Am getting an exception that "Value does not fall within the expected range." But when i use formObj.Show();
the form is getting shown but am unable to access the controls on the form. Can you please help on this?
Thank You
Yashwanth
推荐答案
以前没有看到该错误消息-但是您需要更多信息.在VS中,转到菜单上的调试",然后选择例外".在每个框中打勾,然后按OK.
现在,无论何时抛出异常,无论是否进行处理,您都将获得一个异常.通过调试器运行代码,希望您应该更好地了解到底是什么代码引发了低级异常,以及原因.还要查看InnerException属性-可能是相关的.
Not seen that error message before - but you need more information. In VS go to "Debug" on the menu, and select "Exceptions". Put a tick in every box, and press OK.
You will now get an exception whenever it is thrown - whether it is handled or not. Run your code through the debugger, and hopefully, you should get a better idea of exactly what code is throwing the low level exception, and why. Also look at the InnerException property - it may be relevant.
这篇关于无法使用表单上的控件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文