c#.net 2005中的窗体上未显示控件 [英] controls not shown on forms in c#.net 2005

查看:50
本文介绍了c#.net 2005中的窗体上未显示控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我已经在c#.net中创建了一个表单,并在其上添加了控件.我为控件编写了代码,但是现在控件在窗体上不可见,但是代码仍然存在.控件设计器代码也存在于设计器文件中.所有控件的visible属性都设置为true.
谁能告诉我如何在表单上显示控件?紧急.

在此先感谢

Hello,

I have created a form in c#.net and added controls on it. I wrote code for the controls but now the controls are not visible on form, still the code is present. The control designer code is also present in designer file. All controls visible property is set to true.
Can anybody tell please me how to show controls on form? It''s urgent.

Thanks in advance

推荐答案

还有两件事需要检查:
1.如果它们是自定义控件,则可能需要自己处理它们的绘制.
2.如果它们继承了其他UserControl,则您可能已重写OnPaint()而不被称为基本函数.
3.也许这些控件位于另一个控件的后面:请尝试在控件上使用BringToFront()来查看在运行应用程序时是否出现.
Here are a couple more things to check out:
1. If they are custom controls, you may need to handle the painting of them yourself.
2. If they inherit other UserControls, you may have overridden the OnPaint() and not called the base function.
3. Maybe the controls are behind another control: try using BringToFront() on the controls to see if any appear when you run the app.


它们是否位于不可见的容器中( Visible设置为false)?搜索可见",查看是否在代码中的任何地方将其清除.
Could they be in a container which is invisible (Visible set to false)? Do a search for "visible", see if it is cleared anywhere in the code.


如果indivara所说的内容不起作用,请转到设计器代码,并搜索location属性控制.尝试将其设置为Point(0,0).如果现在可以看到您的控件,则意味着您的控件已放置在窗体边界之外.尝试修复它们.

一切顺利.
If what indivara said doesn''t work then go to the designer code, and search for location property of the control. Try to set it to Point(0, 0). If you can see your control now, then it means your controls are placed out of the form boundary. Try to fix them.

All the best.


这篇关于c#.net 2005中的窗体上未显示控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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