在c#中创建窗口句柄时出错 [英] Error Creating Window Handle in c#

查看:1507
本文介绍了在c#中创建窗口句柄时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨专家

我收到了创建窗口句柄错误,因为我在一段时间内加载了太多控件。基本上我有1个TableLayoutPanel,每个Table加载大约10个自定义控件(每个TableLayoutPanel有3个标签,2个Picturebox和3个文本框控件),并且将添加Usercontrol中的任意位置,通过移动鼠标将重新绘制,因为它们的状态已更改

你可以帮忙解决问题

hi Experts
I'm getting a "Error Creating Window Handle" because I have too many controls being loaded over a period time. Basically I have 1 TableLayoutPanel and each Table loads approx 10 custom controls (each TableLayoutPanel has 3 lables, 2 Picturebox and 3 Text Box control) and Click anywhere in the Usercontrol will be added By moving the Mouse will re-draw because their status is changed
You can help to solve the problem

推荐答案

不,这几乎不是因为你有太多的控件:你的列表看起来不像太大了。要找出确切的解决方案,您需要捕获此异常并提供其完整转储;它应该包括异常堆栈(首先)和所有内部异常,递归。如果要发布此信息,请使用改善答案。 (请不要发布任何答案!)



尽管如此,如果你真的遇到控制太多的问题,请记住:你不应该同时填充所有控件。正确的设计应该显示没有更多的控件,然后用户想要在屏幕上同时看到(并且用户不希望看到很多)。如果您的控件总数远远超过此值,请记住不要显示不可见的控件:创建并添加按需,因为用户选择应该托管这些控件的面板,页面,标签页等。



-SA
No, this is hardly because you have too many controls: your list does not look like too big at all. To find out exact solution you will need to catch this exception and provide its full dump; it should include exception stack (first of all) and all inner exceptions, recursively. If you want to post this information, use "Improve Answer". (Please don't post anything as Answer!)

Nevertheless, if you really face the problem of too many controls, remember: you should not populate all your control at the same time. Right design should show not much more controls then the user want to see at the same time on the screen (and user does not want to see many). If your total number of control much more than that, remember not to show invisible controls: create and adds the on demand, as the user selects panels, pages, tab pages, etc. where those controls are supposed to be hosted.

—SA


这篇关于在c#中创建窗口句柄时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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